import {
EMPTY_OBJ,
Fragment,
NO,
NOOP,
PatchFlagNames,
Teleport,
Transition,
TransitionGroup,
camelize,
capitalize,
computed,
createApp,
createBaseVNode,
createBlock,
createCommentVNode,
createElementBlock,
createPropsRestProxy,
createSlots,
createStaticVNode,
createTextVNode,
createVNode,
defineAsyncComponent,
defineComponent,
effectScope,
extend,
getCurrentInstance,
getCurrentScope,
guardReactiveProps,
h,
inject,
isArray,
isBuiltInDirective,
isHTMLTag,
isMathMLTag,
isObject,
isOn,
isRef,
isReservedProp,
isSVGTag,
isString,
isSymbol,
isVNode,
isVoidTag,
makeMap,
markRaw,
mergeDefaults,
mergeModels,
mergeProps,
nextTick,
normalizeClass,
normalizeProps,
normalizeStyle,
onBeforeMount,
onBeforeUnmount,
onMounted,
onScopeDispose,
onUnmounted,
onUpdated,
openBlock,
parseStringStyle,
provide,
reactive,
readonly,
ref,
render,
renderList,
renderSlot,
resolveComponent,
resolveDynamicComponent,
shallowReactive,
shallowRef,
slotFlagsText,
toDisplayString,
toHandlerKey,
toHandlers,
toRaw,
toValue,
unref,
useId,
useModel,
useSlots,
vModelDynamic,
vModelRadio,
vModelText,
vShow,
vue_runtime_esm_bundler_exports,
watch,
watchEffect,
withCtx,
withDirectives,
withKeys,
withModifiers
} from "./chunk-BY246V3E.js";
import "./chunk-PZ5AY32C.js";
// ../node_modules/vitepress-theme-teek/es/index.mjs
import DefaultTheme2 from "vitepress/theme";
// ../node_modules/vitepress-theme-teek/es/helper/dist/index.mjs
var isExternal = (path) => /^(http?:|https?:|mailto:|tel:)/.test(path);
var isValidURL = (url) => {
try {
new URL(url);
return true;
} catch {
return false;
}
};
var isType = (val) => {
if (val === null) return "null";
if (typeof val !== "object") return typeof val;
else return Object.prototype.toString.call(val).slice(8, -1).toLocaleLowerCase();
};
var is = (val, type2) => {
return Object.prototype.toString.call(val) === `[object ${type2}]`;
};
var isPlainFunction = (val) => {
return is(val, "Function");
};
var isFunction = (val) => {
return is(val, "Function") || isAsyncFunction(val);
};
var isDef = (val) => {
return val !== void 0;
};
var isUnDef = (val) => {
return val === void 0;
};
var isObject2 = (val) => {
return val !== null && is(val, "Object");
};
var isDate = (val) => {
return is(val, "Date");
};
var isNumber = (val) => {
return is(val, "Number") && !Number.isNaN(val);
};
var isStringNumber = (val) => {
if (!isString2(val)) return false;
return !Number.isNaN(Number(val));
};
var isAsyncFunction = (val) => {
return is(val, "AsyncFunction");
};
var isPromise = (val) => {
return is(val, "Promise") && isObject2(val) && isFunction(val.then) && isFunction(val.catch);
};
var isString2 = (val) => {
return is(val, "String");
};
var isBoolean = (val) => {
return is(val, "Boolean");
};
var isArray2 = (val) => {
if (typeof Array.isArray === "undefined") {
return Object.prototype.toString.call(val) === "[object Array]";
}
return Array.isArray(val);
};
var isElement = (val) => {
if (typeof Element === "undefined") return false;
return val instanceof Element;
};
var isNull = (val) => {
return val === null;
};
var isNullAndUnDef = (val) => {
return val === null && val === void 0;
};
var isNullOrUnDef = (val) => {
return val === null || val === void 0;
};
var isPhone = (val) => {
return /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(val);
};
var isImagePath = (path) => {
return /(https?:\/\/|data:image\/).*?\.(png|jpg|jpeg|gif|svg|webp|ico)/gi.test(path);
};
var isImageDom = (o) => {
return o && ["IMAGE", "IMG"].includes(o.tagName);
};
var isIos = () => {
var _a, _b;
return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
};
var isEmpty = (val, checkComplexType = true) => {
if (isNumber(val) && isNaN(val)) return true;
if (val === "" || val === null || val === void 0) return true;
if (!checkComplexType) return false;
if (isArray2(val) && !val.length) return true;
if (isObject2(val) && !Object.keys(val).length) return true;
return false;
};
var isFocusable = (element) => {
if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) {
return true;
}
if (element.tabIndex < 0 || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true") {
return false;
}
switch (element.nodeName) {
case "A": {
return !!element.href && element.rel !== "ignore";
}
case "INPUT": {
return !(element.type === "hidden" || element.type === "file");
}
case "BUTTON":
case "SELECT":
case "TEXTAREA": {
return true;
}
default: {
return false;
}
}
};
var isClient = typeof window !== "undefined" && typeof document !== "undefined";
var isServer = !isClient;
var inBrowser = isClient;
var getNowDate = (format = "yyyy-MM-dd hh:mm:ss", utc = true) => {
return formatDate(/* @__PURE__ */ new Date(), format, utc);
};
var formatDate = (date, format = "yyyy-MM-dd hh:mm:ss", utc = true) => {
if (!date) return "";
const dateObj = new Date(date);
const year = utc ? dateObj.getUTCFullYear() : dateObj.getFullYear();
const month = String((utc ? dateObj.getUTCMonth() : dateObj.getMonth()) + 1).padStart(2, "0");
const day = String(utc ? dateObj.getUTCDate() : dateObj.getDate()).padStart(2, "0");
const hours = String(utc ? dateObj.getUTCHours() : dateObj.getHours()).padStart(2, "0");
const minutes = String(utc ? dateObj.getUTCMinutes() : dateObj.getMinutes()).padStart(2, "0");
const seconds = String(utc ? dateObj.getUTCSeconds() : dateObj.getSeconds()).padStart(2, "0");
return format.replace("yyyy", year.toString()).replace("MM", month).replace("dd", day).replace("hh", hours).replace("mm", minutes).replace("ss", seconds);
};
var formatDiffDate = (startDate, endDate) => {
const start = +new Date(startDate);
const end = endDate ? +new Date(endDate) : +/* @__PURE__ */ new Date();
const diff = Math.abs(end - start);
const oneSeconds = 1e3;
const oneMinute = oneSeconds * 60;
const oneHour = oneMinute * 60;
const oneDay = oneHour * 24;
const oneWeek = oneDay * 7;
const oneMonth = oneDay * 30;
const oneYear = oneMonth * 12;
if (diff < 1) return "刚刚";
if (diff < oneMinute) return `${Math.floor(diff / oneSeconds)} 秒前`;
if (diff < oneHour) return `${Math.floor(diff / oneMinute)} 分前`;
if (diff < oneDay) return `${Math.floor(diff / oneHour)} 时前`;
if (diff < oneWeek) return `${Math.floor(diff / oneDay)} 天前`;
if (diff < oneMonth) return `${Math.floor(diff / oneWeek)} 周前`;
if (diff < oneYear) return `${Math.floor(diff / oneMonth)} 月前`;
return `${Math.floor(diff / oneYear)} 年前`;
};
var formatDiffDateToDay = (startDate, endDate) => {
const start = +new Date(startDate);
const end = endDate ? +new Date(endDate) : +/* @__PURE__ */ new Date();
return Math.floor(Math.abs(start - end) / (1e3 * 60 * 60 * 24));
};
var withBase = (base, path) => {
if (!path) return;
return /^(?:[a-z]+:|\/\/)/i.test(path) || !path.startsWith("/") ? path : `${base}${path}`.replace(/\/+/g, "/");
};
var upperFirst = (str2) => {
return str2.charAt(0).toUpperCase() + str2.slice(1);
};
var addUnit = (value, defaultUnit = "px") => {
if (!value) return "";
if (isNumber(value) || isStringNumber(value)) return `${value}${defaultUnit}`;
else if (isString2(value)) return value;
return "";
};
var removeUnit = (value, defaultUnit = "px") => {
if (!value) return;
if (isNumber(value)) return value;
if (isString2(value)) return Number(value.replace(defaultUnit, ""));
else return;
};
var get = (object, path, defaultValue) => {
let obj = { ...object };
if (!path.includes(".")) return obj[path] || defaultValue;
else {
path.split(".").forEach((item) => obj = obj[item] ?? "");
return obj || defaultValue;
}
};
var removeStorageItem = (key, storage2, vague = false) => {
if (!vague) return storage2.removeItem(key);
const keysToRemove = [];
for (let i = 0; i < storage2.length; i++) {
const key2 = storage2.key(i);
if (key2 && key2.startsWith(key2)) {
keysToRemove.push(key2);
}
}
keysToRemove.forEach((key2) => storage2.removeItem(key2));
};
var hexToRgb = (str2) => {
let hex = "";
const reg = /^\#?[0-9A-Fa-f]{6}$/;
if (!reg.test(str2)) return console.error("[Teek Error] 输入错误的 hex");
str2 = str2.replace("#", "");
hex = str2.match(/../g);
for (let i = 0; i < 3; i++) hex[i] = parseInt(hex[i], 16);
return hex;
};
var rgbToHex = (r, g, b) => {
const reg = /^\d{1,3}$/;
if (!reg.test(r) || !reg.test(g) || !reg.test(b)) return console.error("[Teek Error] 输入错误的 rgb 颜色值");
const hex = [r.toString(16), g.toString(16), b.toString(16)];
for (let i = 0; i < 3; i++) if (hex[i].length === 1) hex[i] = `0${hex[i]}`;
return `#${hex.join("")}`;
};
var getDarkColor = (color, level) => {
const reg = /^\#?[0-9A-Fa-f]{6}$/;
if (!reg.test(color)) return console.error("[Teek Error] 输入错误的 hex 颜色值");
const rgb = hexToRgb(color);
for (let i = 0; i < 3; i++) rgb[i] = Math.round(20.5 * level + rgb[i] * (1 - level));
return rgbToHex(rgb[0], rgb[1], rgb[2]);
};
var getLightColor = (color, level) => {
const reg = /^\#?[0-9A-Fa-f]{6}$/;
if (!reg.test(color)) return console.error("[Teek Error] 输入错误的 hex 颜色值");
const rgb = hexToRgb(color);
for (let i = 0; i < 3; i++) rgb[i] = Math.round(255 * level + rgb[i] * (1 - level));
return rgbToHex(rgb[0], rgb[1], rgb[2]);
};
var baiduAnalytics = (options) => {
var _a;
if (!isClient) return;
const { id, production = true } = options || {};
if (production && true) return;
if (!id) return console.warn("[Teek Warning] Baidu analytics id is empty");
if (!document.querySelector(`#baidu-analytics-${id}`)) {
window._hmt = window._hmt || [];
const script = document.createElement("script");
script.id = `baidu-analytics-${id}`;
script.async = true;
script.src = `https://hm.baidu.com/hm.js?${id}`;
(_a = document.querySelector("head")) == null ? void 0 : _a.appendChild(script);
}
};
var trackPageview = (options, pageUrl) => {
if (!isClient) return;
const { id, production = true } = options || {};
if (production && true) return;
if (!id) return;
if (!pageUrl || !isString2(pageUrl)) pageUrl = "/";
if (pageUrl.startsWith("http")) {
const urlFragment = pageUrl.split("/");
const origin = `${urlFragment[0]}//${urlFragment[2]}`;
pageUrl = pageUrl.replace(origin, "");
}
if (window._hmt) {
window._hmt.push(["_setAccount", id]);
window._hmt.push(["_trackPageview", pageUrl]);
}
};
var googleAnalytics = (options) => {
if (!isClient) return;
if (window.dataLayer && window.gtag) return;
const { id, production = true } = options || {};
if (production && true) return;
if (!id) return console.warn("[Teek Warning] Google analytics id is empty");
if (!document.querySelector(`#google-analytics-${id}`)) {
const gtagScript = document.createElement("script");
gtagScript.id = `google-analytics-${id}`;
gtagScript.src = `https://www.googletagmanager.com/gtag/js?id=${id}`;
gtagScript.async = true;
document.head.appendChild(gtagScript);
window.dataLayer = window.dataLayer || [];
window.gtag = function() {
dataLayer.push(arguments);
};
gtag("js", /* @__PURE__ */ new Date());
gtag("config", id);
}
};
var umamiAnalytics = (options, production = true) => {
if (!isClient) return;
if (production && true) return;
let properties = [];
if (Array.isArray(options)) properties.push(...options);
else properties.push(options);
properties = properties.filter((property) => Boolean(property.id));
if (!properties.length) return;
for (const property of properties) {
const { id, src } = property;
if (!document.querySelector(`#umami-analytics-${id}`)) {
const script = document.createElement("script");
script.id = `umami-analytics-${id}`;
script.async = true;
script.defer = true;
script.setAttribute("data-website-id", id);
script.src = src;
document.head.appendChild(script);
}
}
};
// ../node_modules/vitepress-theme-teek/es/static/iconfont/social/iconfont.mjs
if (typeof window !== "undefined")
window._iconfont_svg_string_4999519 = '', ((l) => {
var c = (t = (t = document.getElementsByTagName("script"))[t.length - 1]).getAttribute("data-injectcss"), t = t.getAttribute("data-disable-injectsvg");
if (!t) {
var o, i, e, a, h2, n = function(c2, t2) {
t2.parentNode.insertBefore(c2, t2);
};
if (c && !l.__iconfont__svg__cssinject__) {
l.__iconfont__svg__cssinject__ = true;
try {
document.write(
""
);
} catch (c2) {
console && console.log(c2);
}
}
o = function() {
var c2, t2 = document.createElement("div");
t2.innerHTML = l._iconfont_svg_string_4999519, (t2 = t2.getElementsByTagName("svg")[0]) && (t2.setAttribute("aria-hidden", "true"), t2.style.position = "absolute", t2.style.width = 0, t2.style.height = 0, t2.style.overflow = "hidden", t2 = t2, (c2 = document.body).firstChild ? n(t2, c2.firstChild) : c2.appendChild(t2));
}, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(o, 0) : (i = function() {
document.removeEventListener("DOMContentLoaded", i, false), o();
}, document.addEventListener("DOMContentLoaded", i, false)) : document.attachEvent && (e = o, a = l.document, h2 = false, d(), a.onreadystatechange = function() {
"complete" == a.readyState && (a.onreadystatechange = null, s());
});
}
function s() {
h2 || (h2 = true, e());
}
function d() {
try {
a.documentElement.doScroll("left");
} catch (c2) {
return void setTimeout(d, 50);
}
s();
}
})(window);
// ../node_modules/vitepress-theme-teek/es/static/icons/aliPay.mjs
var aliPayIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/arrowDown.mjs
var arrowDownIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/category.mjs
var categoryIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/close.mjs
var closeIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/copyright.mjs
var copyrightIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/docAnalysis.mjs
var docAnalysisIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/empty.mjs
var emptyIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/friendLink.mjs
var friendLinkIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/icpRecord.mjs
var icpRecordIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/notice.mjs
var noticeIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/playground.mjs
var playgroundIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/rocket.mjs
var rocketIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/size.mjs
var size = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/tag.mjs
var tagIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme.mjs
var themeIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/topArticle.mjs
var topArticleIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/reading.mjs
var readingIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/clock.mjs
var clockIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/view.mjs
var viewIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/house.mjs
var houseIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/arrowLeft.mjs
var arrowLeftIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/arrowRight.mjs
var arrowRightIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/magic.mjs
var magicIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/comment.mjs
var commentIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/user.mjs
var userIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/calendar.mjs
var calendarIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/folderOpened.mjs
var folderOpenedIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/collectionTag.mjs
var collectionTagIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/editPen.mjs
var editPenIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/github.mjs
var githubIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/copy.mjs
var copyIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/code.mjs
var codeIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/caretTop.mjs
var caretTopIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/weChatPay.mjs
var weChatPayIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/share.mjs
var shareIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/thumbs.mjs
var thumbsIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/externalLink.mjs
var externalLinkIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/dArrowRight.mjs
var dArrowRightIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/dArrowLeft.mjs
var dArrowLeftIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/moreFilled.mjs
var moreFilledIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/fullscreen.mjs
var fullscreenIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/refreshLeft.mjs
var refreshLeftIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/refreshRight.mjs
var refreshRightIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/scaleToOriginal.mjs
var scaleToOriginalIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/zoomIn.mjs
var zoomInIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/zoomOut.mjs
var zoomOutIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/circleCloseFilled.mjs
var circleCloseFilledIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/infoFilled.mjs
var infoFilledIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/successFilled.mjs
var successFilledIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/warningFilled.mjs
var warningFilledIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/questionFilled.mjs
var questionFilledIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/top.mjs
var topIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/lock.mjs
var lockIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/autoWidth.mjs
var autoWidthIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/click.mjs
var clickIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/fullScreenOne.mjs
var fullScreenOneIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/fullscreenTwo.mjs
var fullscreenTwoIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/layout.mjs
var layoutIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/overallReduction.mjs
var overallReductionIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/alignLeft.mjs
var alignLeftIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/alignTextLeft.mjs
var alignTextLeftIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/scale.mjs
var scaleIcon = ``;
// ../node_modules/vitepress-theme-teek/es/static/icons/theme-enhance/water.mjs
var waterIcon = ``;
// ../node_modules/vitepress-theme-teek/es/composables/useScopeDispose.mjs
var useScopeDispose = (fn) => {
if (!getCurrentScope()) return false;
onScopeDispose(fn);
return true;
};
// ../node_modules/vitepress-theme-teek/es/composables/useEventListener.mjs
var useEventListener = (target, event, handler, options) => {
const cleanups = [];
const cleanup = () => {
cleanups.forEach((fn) => fn());
cleanups.length = 0;
};
const register = (el2, event2, listener, options2) => {
el2.addEventListener(event2, listener, options2);
return () => el2.removeEventListener(event2, listener, options2);
};
const el = computed(() => {
if (!isClient) return;
const plain = toValue(target) || window;
return (plain == null ? void 0 : plain.$el) ?? plain;
});
const stopWatch = watch(
el,
(val) => {
cleanup();
if (!val) return;
cleanups.push(register(val, event, handler, options));
},
{ flush: "post", immediate: true }
// flush: "post" 确保在组件挂载后执行
);
const stop = () => {
stopWatch();
cleanup();
};
useScopeDispose(cleanup);
return stop;
};
// ../node_modules/vitepress-theme-teek/es/composables/onClickOutside.mjs
var _iOSWorkaround = false;
var onClickOutside = (target, handler, options = {}) => {
const { ignore = [], capture = true, detectIframe = false, controls = false } = options;
if (!isClient) {
return controls ? { stop: () => {
}, cancel: () => {
}, trigger: () => {
} } : () => {
};
}
if (isIos() && !_iOSWorkaround) {
_iOSWorkaround = true;
const listenerOptions = { passive: true };
Array.from(window.document.body.children).forEach((el) => useEventListener(el, "click", () => {
}, listenerOptions));
useEventListener(window.document.documentElement, "click", () => {
}, listenerOptions);
}
let shouldListen = true;
const shouldIgnore = (event) => {
return toValue(ignore).some((target2) => {
if (typeof target2 === "string") {
return Array.from(window.document.querySelectorAll(target2)).some(
(el) => el === event.target || event.composedPath().includes(el)
);
} else {
const el = toValue(target2);
return el && (event.target === el || event.composedPath().includes(el));
}
});
};
function hasMultipleRoots(target2) {
const vm = toValue(target2);
return vm && vm.$.subTree.shapeFlag === 16;
}
function checkMultipleRoots(target2, event) {
const vm = toValue(target2);
const children = vm.$.subTree && vm.$.subTree.children;
if (children == null || !Array.isArray(children)) return false;
return children.some((child) => child.el === event.target || event.composedPath().includes(child.el));
}
const listener = (event) => {
const plain = toValue(target);
const el = (plain == null ? void 0 : plain.$el) ?? plain;
if (event.target == null) return;
if (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;
if (!el || el === event.target || event.composedPath().includes(el)) return;
if ("detail" in event && event.detail === 0) shouldListen = !shouldIgnore(event);
if (!shouldListen) {
shouldListen = true;
return;
}
handler(event);
};
let isProcessingClick = false;
const cleanup = [
useEventListener(
window,
"click",
(event) => {
if (!isProcessingClick) {
isProcessingClick = true;
setTimeout(() => {
isProcessingClick = false;
}, 0);
listener(event);
}
},
{ passive: true, capture }
),
useEventListener(
window,
"pointerdown",
(e) => {
const plain = toValue(target);
const el = (plain == null ? void 0 : plain.$el) ?? plain;
shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
},
{ passive: true }
),
detectIframe && useEventListener(
window,
"blur",
(event) => {
setTimeout(() => {
var _a;
const plain = toValue(target);
const el = (plain == null ? void 0 : plain.$el) ?? plain;
if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window.document.activeElement))) {
handler(event);
}
}, 0);
},
{ passive: true }
)
].filter(Boolean);
const stop = () => cleanup.forEach((fn) => fn());
if (controls) {
return {
stop,
cancel: () => {
shouldListen = false;
},
trigger: (event) => {
shouldListen = true;
listener(event);
shouldListen = false;
}
};
}
return stop;
};
// ../node_modules/vitepress-theme-teek/es/composables/useAnchorScroll.mjs
import { useData } from "vitepress";
// ../node_modules/vitepress-theme-teek/es/composables/useMounted.mjs
var useMounted = (fn, options = {}) => {
const { sync = false, nexTick = true } = options;
const isMounted = shallowRef(false);
const instance2 = getCurrentInstance();
if (instance2) {
onMounted(() => {
isMounted.value = true;
fn == null ? void 0 : fn();
}, instance2);
} else if (sync) fn == null ? void 0 : fn();
else if (nexTick) nextTick(() => fn == null ? void 0 : fn());
return isMounted;
};
// ../node_modules/vitepress-theme-teek/es/composables/useAnchorScroll.mjs
var useAnchorScroll = () => {
const { theme } = useData();
const currentAnchor = reactive({ id: "", top: -1 });
const calculateCurrentAnchor = () => {
const anchors = document.querySelectorAll(".content-container .main :is(h1, h2, h3, h4, h5, h6)");
for (let i = 0; i < anchors.length; i++) {
const anchor = anchors[i];
const computedStyle = window.getComputedStyle(anchor);
if (computedStyle.display === "none") break;
const rect = anchor.getBoundingClientRect();
if (rect.top <= 150 && anchor.id !== currentAnchor.id) {
currentAnchor.id = anchor.id;
currentAnchor.top = rect.top;
}
}
};
useMounted(() => {
useEventListener(window, "scroll", calculateCurrentAnchor);
});
const startWatch = () => {
if (theme.value.anchorScroll === false) return;
watch(
() => currentAnchor.id,
(val) => {
if (!isClient || !val) return;
window.history.replaceState(history.state || null, "", `#${val}`);
}
);
};
return { startWatch };
};
// ../node_modules/vitepress-theme-teek/es/composables/useUvPv.mjs
var DEFAULT_SITE_PV = 9999;
var DEFAULT_SITE_UV = 9999;
var DEFAULT_PAGE_PV = 9999;
var DEFAULT_PAGE_UV = 9999;
var DEFAULT_TODAY_DATA = {
site_pv: 9999,
site_uv: 9999,
page_pv: 9999,
page_uv: 9999
};
var DEFAULT_YESTERDAY_DATA = {
site_pv: 9999,
site_uv: 9999,
page_pv: 9999,
page_uv: 9999
};
var useUvPv = (immediate = false, options = {}) => {
const { url, provider = "busuanzi", tryRequest = false, tryCount = 5, tryIterationTime = 2e3, requestFn } = options;
const sitePv = ref(0);
const siteUv = ref(0);
const pagePv = ref(0);
const pageUv = ref(0);
const today = ref({ site_pv: 0, site_uv: 0, page_pv: 0, page_uv: 0 });
const yesterday = ref({ site_pv: 0, site_uv: 0, page_pv: 0, page_uv: 0 });
const isGet = ref(true);
const request = () => {
if (!isClient) return;
if (isGet.value === false) return;
isGet.value = false;
const call = async (url2) => {
if (requestFn) {
const response = await requestFn(url2, createScript);
window.dispatchEvent(new CustomEvent("views", { detail: response }));
return Promise.resolve(response);
}
switch (provider) {
case "busuanzi":
return callBusuanzi(url2);
case "vercount":
return callVercount(url2);
default:
return callBusuanzi(url2);
}
};
call(url || void 0).then((data) => {
sitePv.value = data.site_pv || DEFAULT_SITE_PV;
siteUv.value = data.site_uv || DEFAULT_SITE_UV;
pagePv.value = data.page_pv || DEFAULT_PAGE_PV;
pageUv.value = data.page_uv || DEFAULT_PAGE_UV;
today.value = data.today || DEFAULT_TODAY_DATA;
yesterday.value = data.yesterday || DEFAULT_YESTERDAY_DATA;
isGet.value = true;
window.dispatchEvent(new CustomEvent("views", { detail: data }));
});
};
immediate && nextTick(request);
if (tryRequest) {
let i = 0;
const clearTimer = (timer2) => {
if (timer2) {
clearInterval(timer2);
timer2 = null;
}
};
const timer = setInterval(() => {
if (isGet.value) return clearTimer(timer);
request();
i += tryIterationTime;
if (i > tryIterationTime * tryCount) clearTimer(timer);
}, tryIterationTime);
useScopeDispose(() => clearTimer(timer));
}
return {
sitePv: readonly(sitePv),
siteUv: readonly(siteUv),
pagePv: readonly(pagePv),
pageUv: readonly(pageUv),
today: readonly(today),
yesterday: readonly(yesterday),
isGet: readonly(isGet),
request
};
};
var createScript = (url, immediate = true) => {
const scriptDom = document.createElement("script");
scriptDom.type = "text/javascript";
scriptDom.defer = true;
scriptDom.src = url;
immediate && document.body.appendChild(scriptDom);
return scriptDom;
};
var callBusuanzi = (url = "//busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback") => {
const jsonpCallback = "BusuanziCallback_" + Math.floor(1099511627776 * Math.random());
url = url.replace("=BusuanziCallback", "=" + jsonpCallback);
const scriptDom = createScript(url);
scriptDom.referrerPolicy = "no-referrer-when-downgrade";
let response;
window[jsonpCallback] = (data) => response = data;
return new Promise((resolve, reject) => {
scriptDom.onload = () => {
resolve(response);
setTimeout(() => {
document.body.removeChild(scriptDom);
}, 10);
};
scriptDom.onerror = () => reject("Error Loading " + url);
});
};
var callVercount = async (url = "//events.vercount.one/js", timeout = 5e3) => {
localStorage.removeItem("visitorCountData");
const scriptDom = createScript(url);
return new Promise((resolve, reject) => {
scriptDom.onload = () => {
const intervalTime = 500;
let count = timeout / intervalTime;
const timer = setInterval(() => {
count--;
if (count <= 0) {
clearInterval(timer);
resolve({});
}
const visitorCountData = localStorage.getItem("visitorCountData");
if (visitorCountData) {
clearInterval(timer);
resolve(JSON.parse(visitorCountData));
}
}, intervalTime);
setTimeout(() => {
document.body.removeChild(scriptDom);
}, 10);
};
scriptDom.onerror = () => reject("Error Loading " + url);
});
};
// ../node_modules/vitepress-theme-teek/es/composables/useClipboard.mjs
var useClipboard = (timeout = 1500) => {
const copied = ref(false);
const text = ref("");
const isSupported = ref(false);
if (isClient && !!navigator.clipboard && !!document.execCommand) isSupported.value = true;
else isSupported.value = true;
const copy = async (str2, size2 = -1) => {
if (!isClient) return;
if (navigator.clipboard) {
return await navigator.clipboard.writeText(str2).then(() => {
text.value = str2;
copied.value = true;
resetCopied();
});
}
const input = document.createElement("input");
input.setAttribute("readonly", "readonly");
input.setAttribute("value", str2);
document.body.appendChild(input);
input.select();
if (size2 > 0) input.setSelectionRange(0, size2);
if (document.execCommand("copy")) {
text.value = str2;
document.execCommand("copy");
copied.value = true;
resetCopied();
}
document.body.removeChild(input);
};
const resetCopied = () => {
setTimeout(() => {
copied.value = false;
}, timeout);
};
return { copy, text, copied, isSupported };
};
// ../node_modules/vitepress-theme-teek/es/composables/cssModule/namespace.module.scss.mjs
var namespaceModule = { "namespace": "tk" };
// ../node_modules/vitepress-theme-teek/es/composables/useNamespace.mjs
var useNamespace = (block = "", namespaceOverrides) => {
const finalNamespace = namespaceOverrides || namespaceModule.namespace;
const b = (blockSuffix) => {
return createBem(finalNamespace, block, blockSuffix);
};
const e = (element) => {
return createBem(finalNamespace, block, "", element);
};
const m = (modifier) => {
return createBem(finalNamespace, block, "", "", modifier);
};
const be = (blockSuffix, element) => {
return createBem(finalNamespace, block, blockSuffix, element);
};
const bm = (blockSuffix, modifier) => {
return createBem(finalNamespace, block, blockSuffix, "", modifier);
};
const em = (element, modifier) => {
return createBem(finalNamespace, block, "", element, modifier);
};
const bem = (blockSuffix, element, modifier) => {
return createBem(finalNamespace, block, blockSuffix, element, modifier);
};
const is2 = (name, bool2 = true) => {
return bool2 ? `is-${name}` : "";
};
const has = (name, bool2 = true) => {
return bool2 ? `has-${name}` : "";
};
const createBem = (namespace, block2, blockSuffix, element, modifier) => {
let space = `${namespace}-${block2}`;
if (blockSuffix) space += `-${blockSuffix}`;
if (element) space += `__${element}`;
if (modifier) space += `--${modifier}`;
return space;
};
const join = (scope) => {
return `${finalNamespace}-${scope}`;
};
const cssVar = (name) => `var(--${finalNamespace}-${name})`;
const cssVarName = (name) => `--${finalNamespace}-${name}`;
const storageKey = (...key) => `${finalNamespace}:${key.join(":")}`;
return {
namespaceModule,
namespace: namespaceModule.namespace,
b,
e,
m,
be,
bm,
em,
bem,
is: is2,
has,
createBem,
join,
cssVar,
cssVarName,
storageKey
};
};
// ../node_modules/vitepress-theme-teek/es/composables/useCopyBanner.mjs
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
var useCopyBanner = (text = "复制成功,复制和转载请标注本文地址", timeout = 3e3) => {
if (!isClient) return;
const ns4 = useNamespace("copy-banner");
const listenerCopy = () => {
var _a;
if (!((_a = window.getSelection()) == null ? void 0 : _a.toString().trim())) return;
hideAllCopyBanner();
const slideClass = ns4.e("slide");
const banner = document.createElement("div");
const slide = document.createElement("div");
banner.className = ns4.b();
banner.innerHTML = `
`;
slide.className = slideClass;
banner.appendChild(slide);
document.body.appendChild(banner);
setTimeout(() => {
banner.classList.add("is-show");
slide.style.width = "100%";
}, 10);
setTimeout(() => {
banner.classList.add("is-hide");
}, timeout);
};
const hideAllCopyBanner = () => {
const banner = document.querySelector(`.${ns4.b()}`);
if (!banner) return;
banner.remove();
};
useEventListener(document, "copy", listenerCopy, { passive: true });
};
// ../node_modules/vitepress-theme-teek/es/composables/useDebounce.mjs
var useDebounce = (func, delay = 0, immediate = false) => {
let timer;
return (...args) => {
const callNow = immediate && !timer;
if (callNow) func(...args);
const clearTimer = () => {
if (timer) {
clearTimeout(timer);
timer = null;
}
};
const later = () => {
clearTimer();
if (!immediate) func(...args);
};
clearTimer();
timer = setTimeout(later, delay);
};
};
// ../node_modules/vitepress-theme-teek/es/composables/useElementHover.mjs
var useElementHover = (el, options = {}) => {
const { delayEnter = 0, delayLeave = 0 } = options;
const isHovered = shallowRef(false);
let timer;
const toggle = (entering) => {
const delay = entering ? delayEnter : delayLeave;
if (timer) {
clearTimeout(timer);
timer = null;
}
if (delay) timer = setTimeout(() => isHovered.value = entering, delay);
else isHovered.value = entering;
};
if (!isClient) return isHovered;
useEventListener(el, "mouseenter", () => toggle(true), { passive: true });
useEventListener(el, "mouseleave", () => toggle(false), { passive: true });
return isHovered;
};
// ../node_modules/vitepress-theme-teek/es/locale/lang/zh-cn.mjs
var zhCn = {
lang: "zh-CN",
tk: {
archives: {
label: "归档页",
title: "归档",
totalCount: "总共 {count} 篇文章",
year: "年",
month: "月",
count: "篇",
notFound: "未指定"
},
articleAnalyze: {
label: "文章分析",
wordCount: "文章字数",
readingTime: "预计阅读时长",
pageView: "浏览量"
},
articleAppreciation: {
label: "文章赞赏",
contentLabel: "赞赏方式"
},
articleBreadcrumb: {
label: "文章面包屑",
home: "首页"
},
breadcrumb: {
label: "面包屑"
},
articleInfo: {
label: "文章信息",
author: "作者",
createTime: "创建时间",
updateTime: "更新时间",
category: "分类",
tag: "标签"
},
articleOverview: {
label: "文章清单",
overview: " 清单",
category: " 目录",
name: "文章目录",
title: "文章标题",
date: "发布时间",
wordCount: "文章字数",
readingTime: "预阅读时长"
},
articleShare: {
label: "文章分享",
text: "分享此页面",
copiedText: "链接已复制"
},
articleTitle: {
label: "文章标题"
},
articleUpdate: {
label: "最近更新"
},
catalogue: {
label: "目录页",
title: "目录"
},
demoCode: {
playground: "在 Playground 中编辑",
github: "在 Github 中编辑",
copy: "复制代码",
collapseSource: "查看源代码",
expandSource: "隐藏源代码",
notSupport: "浏览器不支持复制",
copySuccess: "复制成功",
copyFail: "复制失败"
},
footerInfo: {
label: "页脚信息",
socialLabel: "社交媒体",
infoLabel: "页脚内容"
},
home: {
label: "首页",
postLabel: "文章列表",
cardLabel: "侧边卡片栏"
},
homeBanner: {
label: "首页横幅",
wavesLabel: "首页横幅波浪",
bgImgLabel: "首页横幅背景图",
maskLabel: "首页横幅遮罩层",
bgPureLabel: "首页横幅背景色",
contentLabel: "首页横幅内容",
titleLabel: "首页横幅标题",
descLabel: "首页横幅描述",
descSwitchLabel: "描述动态切换",
descTypedLabel: "描述打字机效果",
featureLabel: "首页横幅功能特性"
},
homePost: {
label: "文章列表",
emptyLabel: "暂无文章",
pageLabel: "分页导航",
moreLabel: "阅读全文 >",
pin: "置顶:{sticky}",
pinLabel: "置顶标志",
excerptLabel: "文章摘要",
infoLabel: "文章信息",
coverImgLabel: "文章封面图"
},
pageCard: {
label: "首页卡片",
prev: "上一页",
next: "下一页"
},
categoryCard: {
pageTitle: "{icon}全部分类",
homeTitle: "{icon}文章分类",
label: "首页分类卡片",
emptyLabel: "暂无文章分类",
listLabel: "分类列表",
moreLabel: "更多 ..."
},
docAnalysisCard: {
title: "{icon}站点信息",
totalPosts: "文章数目",
weekAddNum: "近一周新增",
monthAddNum: "近一月新增",
runtime: "已运行时间",
totalWordCount: "本站总字数",
lastActiveTime: "最后活动时间",
viewCount: "本站被访问了",
visitCount: "本站曾来访过",
fileUnit: "篇",
runtimeLess: "不到一天",
runtimeUnit: "天",
wordCountUnit: "字",
viewCountUnit: "次",
visitCountUnit: "人",
label: "首页站点分析卡片"
},
friendLinkCard: {
title: "{icon}友情链接",
emptyLabel: "暂无友情链接",
label: "首页友情链接卡片",
listLabel: "友情链接列表"
},
myCard: {
label: "我的信息卡片",
avatarAlt: "博主头像",
avatarTitle: "我好看吗",
socialLabel: "社交链接",
bloggerLabel: "博主信息"
},
tagCard: {
pageTitle: "{icon}全部标签",
homeTitle: "{icon}热门标签",
label: "首页标签卡片",
emptyLabel: "暂无标签",
listLabel: "标签列表",
moreLabel: "更多 ..."
},
topArticleCard: {
title: "{icon}精选文章",
label: "首页精选文章卡片",
emptyLabel: "暂无精选文章",
listLabel: "精选文章列表"
},
image: {
error: "加载失败"
},
notice: {
label: "公告栏",
title: "公告",
openLabel: "打开公告弹窗",
closeLabel: "关闭公告弹窗",
headLabel: "公告头部区域",
contentLabel: "公告内容"
},
pagination: {
goto: "前往",
pagesize: "条/页",
total: "共 {total} 条",
pageClassifier: "页",
page: "页",
prev: "上一页",
next: "下一页",
currentPage: "第 {pager} 页",
prevPages: "向前 {pager} 页",
nextPages: "向后 {pager} 页"
},
rightBottomButton: {
backTopTitle: "返回顶部",
themeSizeTitle: "主题尺寸切换",
themeStyleTitle: "主题风格切换",
toComment: "前往评论"
},
themeEnhance: {
title: "布局增强",
layoutSwitch: {
title: "布局切换",
helpDesc: "调整 VitePress 的布局样式,以适配不同的阅读习惯和屏幕环境。",
fullWidthTipTitle: "全部展开",
fullWidthHelpTipContent: "使侧边栏和内容区域占据整个屏幕的全部宽度。",
sidebarWidthAdjustableOnlyTipTitle: "全部展开,但侧边栏宽度可调",
sidebarWidthAdjustableOnlyHelpTipContent: "侧边栏宽度可调,但内容区域宽度不变,调整后的侧边栏将可以占据整个屏幕的最大宽度。",
bothWidthAdjustableTipTitle: "全部展开,且侧边栏和内容区域宽度均可调",
bothWidthAdjustableHelpTipContent: "侧边栏和内容区域宽度均可调,调整后的侧边栏和内容区域将可以占据整个屏幕的最大宽度。",
originalWidthTipTitle: "原始宽度",
originalWidthHelpTipContent: "原始的 VitePress 默认布局宽度"
},
docLayoutMaxWidth: {
title: "文档内容最大宽度",
helpDesc: "调整 VitePress 布局中文档内容区域的宽度,以适配不同的阅读习惯和屏幕环境。",
helpTipTitle: "调整文档内容最大宽度",
helpTipContent: "一个可调整的滑块,用于选择和自定义文档内容最大宽度。"
},
pageLayoutMaxWidth: {
title: "页面最大宽度",
helpDesc: "调整 VitePress 布局中页面的宽度,以适配不同的阅读习惯和屏幕环境。",
helpTipTitle: "调整页面最大宽度",
helpTipContent: "一个可调整的滑块,用于选择和自定义页面最大宽度。"
},
themeColor: {
title: "主题色",
speedLabel: "扩散",
vpLabel: "VitePress 主题",
epLabel: "ElementPlus 主题",
vpTip: "VitePress 主题",
epTip: "ElementPlus 主题",
defaultLabel: "预设",
blueLabel: "蓝色",
greenLabel: "绿色",
yellowLabel: "黄色",
redLabel: "红色",
helpDesc: "提供 VitePress 的基础色板和 ElementPlus 的基础色板进行选择,通过扩散开关可以将主题色扩散至其他元素,如侧边栏背景色、字体色等",
vpHelpTipTitle: "VitePress 基础色板",
vpHelpTipContent: "提供蓝(预设)、绿、黄、红 4 种 VitePress 基础色板",
epHelpTipTitle: "ElementPlus 基础色板",
epHelpTipContent: "提供蓝、绿、黄、红 4 种 ElementPlus 基础色板"
},
spotlight: {
title: "聚光灯",
helpDesc: "支持在正文中高亮当前鼠标悬停的行和元素,以优化阅读和专注困难的用户的阅读体验。",
onTipTitle: "开启",
onHelpTipContent: "开启聚光灯。",
offTipTitle: "关闭",
offHelpTipContent: "关闭聚光灯。"
},
spotlightStyles: {
title: "聚光灯样式",
helpDesc: "调整聚光灯的样式。",
asideTipTitle: "置于侧边",
asideHelpTipContent: "在当前鼠标悬停的元素旁边添加一条固定的纯色线以突出显示当前鼠标悬停的位置。",
underTipTitle: "置于底部",
underHelpTipContent: "在当前鼠标悬停的元素下方添加一个纯色背景以突出显示当前鼠标悬停的位置。"
}
},
login: {
label: "登录页",
reset: "重置",
login: "登录",
loginSuccess: "登录成功!",
loginError: "用户名或者密码错误!",
loginInfoNonNull: "请输入用户名和密码!",
usernamePlaceholder: "请输入用户名",
passwordPlaceholder: "请输入密码",
verifyCodePlaceholder: "请输入验证码",
verifyCodeNonNull: "请输入验证码",
verifyCodeError: "请输入正确的验证码"
},
riskLink: {
label: "风险链接提示页",
title: "即将离开 {name},请注意财产安全",
linkIllegal: "链接安全性校验中,请稍后 ...",
confirmButtonText: "继续访问"
},
sidebarTrigger: {
label: "侧边栏展开/折叠"
}
}
};
// ../node_modules/vitepress-theme-teek/es/composables/useLocale.mjs
var localeContextKey = Symbol("localeContextKey");
var useLocale = (localeOverride) => {
const locale = localeOverride || inject(localeContextKey, ref());
const finalLocale = computed(() => (locale == null ? void 0 : locale.value) || zhCn);
const lang = computed(() => finalLocale.value.lang);
const localeRef = isRef(finalLocale) ? finalLocale : ref(finalLocale);
const translate = (path, option, locale2) => {
return get(locale2, path, path).replace(/\{(\w+)\}/g, (_, key) => `${(option == null ? void 0 : option[key]) ?? `{${key}}`}`);
};
return {
lang,
locale: localeRef,
t: (path, option) => {
return translate(path, option, finalLocale.value);
},
translate
};
};
// ../node_modules/vitepress-theme-teek/es/composables/useMediaQuery.mjs
var useMediaQuery = (query, match = true) => {
const isSupported = shallowRef(false);
useMounted(() => {
isSupported.value = window && "matchMedia" in window && typeof window.matchMedia === "function";
});
const mediaQuery = shallowRef();
const matches = shallowRef(false);
const handler = (event) => {
matches.value = event.matches;
};
watchEffect(() => {
if (!isSupported.value) return;
mediaQuery.value = window.matchMedia(toValue(query));
matches.value = mediaQuery.value.matches;
});
useEventListener(mediaQuery, "change", handler, { passive: true });
return computed(() => match ? matches.value : !matches.value);
};
// ../node_modules/vitepress-theme-teek/es/composables/useWindowSize.mjs
var useWindowSize = (sizeChangedCallback, options = {}) => {
const {
initialWidth = Number.POSITIVE_INFINITY,
initialHeight = Number.POSITIVE_INFINITY,
includeScrollbar = true,
type: type2 = "inner"
} = options;
const width = shallowRef(initialWidth);
const height = shallowRef(initialHeight);
let stop = () => {
};
const update = useDebounce(() => {
if (!isClient) return;
if (type2 === "outer") {
width.value = window.outerWidth;
height.value = window.outerHeight;
} else if (type2 === "visual" && window.visualViewport) {
const { width: visualViewportWidth, height: visualViewportHeight, scale } = window.visualViewport;
width.value = Math.round(visualViewportWidth * scale);
height.value = Math.round(visualViewportHeight * scale);
} else if (includeScrollbar) {
width.value = window.innerWidth;
height.value = window.innerHeight;
} else {
width.value = window.document.documentElement.clientWidth;
height.value = window.document.documentElement.clientHeight;
}
sizeChangedCallback == null ? void 0 : sizeChangedCallback(width.value, height.value);
}, 100);
update();
useMounted(update);
stop = useEventListener(() => window, "resize", update, { passive: true });
if (isClient && type2 === "visual" && window.visualViewport) {
stop = useEventListener(window.visualViewport, "resize", update, { passive: true });
}
return { width, height, update, stop };
};
// ../node_modules/vitepress-theme-teek/es/composables/useScrollbarSize.mjs
var useScrollbarSize = () => {
const width = ref(0);
const height = ref(0);
let measureElement = null;
const createMeasureElement = () => {
var _a;
if (measureElement) return measureElement;
(_a = document.querySelector("#measure-element")) == null ? void 0 : _a.remove();
measureElement = document.createElement("div");
measureElement.id = "measure-element";
measureElement.style.cssText = `
position: fixed;
top: -9999px;
left: 0;
width: 100px;
height: 100px;
overflow: scroll;
visibility: hidden;
`;
document.body.appendChild(measureElement);
return measureElement;
};
const clearMeasureElement = () => {
if (!measureElement) return;
if (document.body.contains(measureElement)) {
document.body.removeChild(measureElement);
measureElement = null;
}
};
const calculate = () => {
if (!isClient) return;
const docElem = document.documentElement;
const isQuirksMode = document.compatMode === "BackCompat";
const hasVertical = isQuirksMode ? document.body.scrollHeight > document.body.clientHeight : docElem.scrollHeight > docElem.clientHeight;
const hasHorizontal = isQuirksMode ? document.body.scrollWidth > document.body.clientWidth : docElem.scrollWidth > docElem.clientWidth;
if (!hasVertical && !hasHorizontal) {
width.value = 0;
height.value = 0;
return;
}
const measure = createMeasureElement();
width.value = hasVertical ? measure.offsetWidth - measure.clientWidth : 0;
height.value = hasHorizontal ? measure.offsetHeight - measure.clientHeight : 0;
};
const update = () => {
calculate();
};
useEventListener(() => window, "resize", update);
useMounted(() => {
createMeasureElement();
calculate();
});
calculate();
useScopeDispose(clearMeasureElement);
return { width, height, update };
};
// ../node_modules/vitepress-theme-teek/es/composables/usePopoverSize.mjs
var AUTO = "auto";
var defaultSpace = 10;
var usePopoverSize = (trigger, popover, options = {}) => {
const { placement = "bottom", offset = 0, xOffset = 0, yOffset = 0 } = options;
const top = ref(AUTO);
const right = ref(AUTO);
const bottom = ref(AUTO);
const left = ref(AUTO);
const { width: windowWidth, height: windowHeight } = useWindowSize();
const { width: scrollbarWidth, height: scrollbarHeight } = useScrollbarSize();
const triggerEl = computed(() => {
const plain = toValue(trigger);
return (plain == null ? void 0 : plain.$el) ?? plain;
});
const popoverEl = computed(() => {
const plain = toValue(popover);
return (plain == null ? void 0 : plain.$el) ?? plain;
});
const calculatePosition = async () => {
if (!isClient || !triggerEl.value || !popoverEl.value) return;
await nextTick();
const {
top: triggerTop,
right: triggerLeftWidth,
// 等于 left + width
bottom: triggerTopHeigh,
// 等于 top + height
left: triggerLeft,
width: triggerWidth,
height: triggerHeight
} = triggerEl.value.getBoundingClientRect();
const triggerRight = windowWidth.value - triggerLeftWidth;
const triggerBottom = windowHeight.value - triggerTopHeigh;
const popoverWidth = popoverEl.value.offsetWidth;
const popoverHeight = popoverEl.value.offsetHeight;
const x = window.scrollX + (offset || xOffset);
const y = window.scrollY + (offset || yOffset);
let popoverTop = AUTO;
let popoverRight = AUTO;
let popoverBottom = AUTO;
let popoverLeft = AUTO;
const placementIsY = ["top", "bottom"].some((item) => placement.startsWith(item));
const placementIsX = ["left", "right"].some((item) => placement.startsWith(item));
const expectTop = () => triggerTop + triggerHeight + y;
const expectRight = () => triggerRight + triggerWidth - x - scrollbarWidth.value;
const expectBottom = () => triggerBottom + triggerHeight - y - scrollbarHeight.value;
const expectLeft = () => triggerLeft + triggerWidth + x;
if (placementIsY) {
if (placement.endsWith("start")) popoverLeft = expectLeft() - triggerWidth;
else if (placement.endsWith("end")) popoverRight = expectRight() - triggerWidth;
else popoverLeft = triggerLeft + triggerWidth / 2 - popoverWidth / 2 + x;
} else if (placementIsX) {
if (placement.endsWith("start")) popoverTop = expectTop() - triggerHeight;
else if (placement.endsWith("end")) popoverBottom = expectBottom() - triggerHeight;
else popoverTop = triggerTop + triggerHeight / 2 - popoverHeight / 2 + y;
}
if (placement.startsWith("top")) popoverBottom = expectBottom() + defaultSpace;
else if (placement.startsWith("right")) popoverLeft = expectLeft() + defaultSpace;
else if (placement.startsWith("bottom")) popoverTop = expectTop() + defaultSpace;
else if (placement.startsWith("left")) popoverRight = expectRight() + defaultSpace;
const isOverTop = () => !isString2(popoverBottom) && popoverBottom + popoverHeight > windowHeight.value - y;
const isOverRight = () => !isString2(popoverLeft) && popoverLeft + popoverWidth > windowWidth.value + x;
const isOverBottom = () => !isString2(popoverTop) && popoverTop + popoverHeight > windowHeight.value + y;
const isOverLeft = () => !isString2(popoverRight) && popoverRight + popoverWidth > windowWidth.value - x;
if (isOverTop()) {
popoverTop = (placementIsX ? expectTop() - triggerHeight : expectTop()) + defaultSpace;
if (isOverBottom()) popoverTop = AUTO;
else popoverBottom = AUTO;
}
if (isOverBottom()) {
popoverBottom = (placementIsX ? expectBottom() - triggerHeight : expectBottom()) + defaultSpace;
if (isOverTop()) popoverBottom = AUTO;
else popoverTop = AUTO;
}
if (isOverRight()) {
popoverRight = (placementIsY ? expectRight() - triggerWidth : expectRight()) + defaultSpace;
if (isOverLeft()) popoverRight = AUTO;
else popoverLeft = AUTO;
}
if (isOverLeft()) {
popoverLeft = (placementIsY ? expectLeft() - triggerWidth : expectLeft()) + defaultSpace;
if (isOverRight()) popoverLeft = AUTO;
else popoverRight = AUTO;
}
top.value = popoverTop;
right.value = popoverRight;
bottom.value = popoverBottom;
left.value = popoverLeft;
};
calculatePosition();
const update = () => {
calculatePosition();
};
useEventListener(() => window, "scroll", update);
useEventListener(() => window, "resize", update);
return { top, right, bottom, left, update };
};
// ../node_modules/vitepress-theme-teek/es/composables/useScrollData.mjs
var useScrollData = (data, limit, options = {}) => {
const { intervalTime = 3e3, reloadWhenDataChanged = false } = options;
const dataComputed = computed(() => toValue(data) || []);
const visibleData = ref(dataComputed.value.slice(0, limit));
let currentIndex = limit;
let timer = null;
const scrollData = () => {
const nextIndex = (currentIndex + 1) % dataComputed.value.length;
visibleData.value.push(dataComputed.value[nextIndex]);
visibleData.value.shift();
currentIndex = nextIndex;
};
const start = () => {
scrollData();
timer = setInterval(() => {
scrollData();
}, intervalTime);
};
const stop = (restore = false) => {
if (timer) {
clearInterval(timer);
timer = null;
}
if (restore) {
visibleData.value = dataComputed.value.slice(0, limit);
currentIndex = limit;
}
};
const restart = () => {
stop(true);
start();
};
if (reloadWhenDataChanged) watch(dataComputed, () => restart());
useScopeDispose(stop);
return {
data: visibleData,
start,
stop,
restart
};
};
// ../node_modules/vitepress-theme-teek/es/composables/useStorage.mjs
var StorageSerializers = {
boolean: { read: (v) => v === "true", write: (v) => String(v) },
object: { read: (v) => JSON.parse(v), write: (v) => JSON.stringify(v) },
number: { read: (v) => Number.parseFloat(v), write: (v) => String(v) },
any: { read: (v) => v, write: (v) => String(v) },
string: { read: (v) => v, write: (v) => String(v) },
map: {
read: (v) => new Map(JSON.parse(v)),
write: (v) => JSON.stringify(Array.from(v.entries()))
},
set: { read: (v) => new Set(JSON.parse(v)), write: (v) => JSON.stringify(Array.from(v)) },
date: { read: (v) => new Date(v), write: (v) => v.toISOString() }
};
var guessSerializerType = (rawInit) => {
if (rawInit == null) return "any";
if (rawInit instanceof Set) return "set";
if (rawInit instanceof Map) return "map";
if (rawInit instanceof Date) return "date";
if (typeof rawInit === "boolean") return "boolean";
if (typeof rawInit === "string") return "string";
if (typeof rawInit === "number") return "number";
if (typeof rawInit === "object") return "object";
return "any";
};
var useStorage = (key, defaults, storageType = "localStorage", options = {}) => {
const { flush = "pre", deep = true, writeDefaults = true, mergeDefaults: mergeDefaults2 = false, initOnMounted } = options;
const rawInit = toValue(defaults);
const data = ref(rawInit);
if (!isClient) return data;
const type2 = guessSerializerType(rawInit);
const serializer = StorageSerializers[type2];
const keyComputed = computed(() => toValue(key));
const storage2 = storageType === "localStorage" ? localStorage : sessionStorage;
watch(keyComputed, () => update(), { flush });
watch(data, () => write(data.value), { flush, deep });
useMounted(() => {
if (initOnMounted) update();
});
const dispatchWriteEvent = (oldValue, newValue) => {
if (window) {
const payload = { key: keyComputed.value, oldValue, newValue, storageArea: storage2 };
window.dispatchEvent(new StorageEvent("storage", payload));
}
};
const write = (val) => {
const oldValue = storage2.getItem(keyComputed.value);
if (val == null) {
dispatchWriteEvent(oldValue, null);
storage2.removeItem(keyComputed.value);
} else {
const serialized = serializer.write(val);
if (oldValue !== serialized) {
storage2.setItem(keyComputed.value, serialized);
dispatchWriteEvent(oldValue, serialized);
}
}
};
const read = (event) => {
const rawValue = event ? event.newValue : storage2.getItem(keyComputed.value);
if (rawValue == null) {
if (writeDefaults && rawInit != null) storage2.setItem(keyComputed.value, serializer.write(rawInit));
return rawInit;
}
if (!event && mergeDefaults2) {
const value = serializer.read(rawValue);
if (typeof mergeDefaults2 === "function") return mergeDefaults2(value, rawInit);
if (type2 === "object" && !Array.isArray(value)) return { ...rawInit, ...value };
return value;
}
if (typeof rawValue !== "string") return rawValue;
else return serializer.read(rawValue);
};
const update = (event) => {
if (event && event.storageArea !== storage2) return;
if (event && event.key == null) {
data.value = rawInit;
return;
}
if (event && event.key !== keyComputed.value) return;
if ((event == null ? void 0 : event.newValue) !== serializer.write(data.value)) data.value = read(event);
};
if (!initOnMounted) update();
useEventListener(() => window, "storage", update, { passive: true });
return data;
};
// ../node_modules/vitepress-theme-teek/es/composables/useSwitchData.mjs
var useSwitchData = (dataList, options = {}) => {
const {
timeout = 4e3,
shuffle = false,
reloadWhenDataChanged = false,
onBeforeUpdate,
onUpdate,
onAfterUpdate
} = options;
const dataListComputed = computed(() => toValue(dataList) || []);
const index2 = ref(-1);
let timer;
const splitOutRandom = (dataList2) => {
let newIndex;
do {
newIndex = Math.floor(Math.random() * dataList2.length);
} while (newIndex === index2.value);
index2.value = newIndex;
return dataList2[newIndex];
};
const data = ref(shuffle ? splitOutRandom(dataListComputed.value) : dataListComputed.value[0]);
const splitOutOrder = (dataList2) => {
index2.value = (index2.value + 1) % dataList2.length;
return dataList2[index2.value];
};
const clearTimer = () => {
if (timer) {
clearTimeout(timer);
timer = null;
}
};
const startTimer = () => {
clearTimer();
if (timeout > 0) {
timer = setTimeout(start, timeout);
}
};
const start = () => {
const dataListConst = dataListComputed.value;
if (dataListConst.length < 1) return;
if (dataListConst.length === 1) {
data.value = dataListConst[0];
return;
}
startTimer();
let newValue;
if (shuffle) newValue = splitOutRandom(dataListConst);
else newValue = splitOutOrder(dataListConst);
if (newValue === data.value) return;
onBeforeUpdate == null ? void 0 : onBeforeUpdate(newValue);
if (onUpdate) return onUpdate(data, newValue);
data.value = newValue;
onAfterUpdate == null ? void 0 : onAfterUpdate(newValue);
};
const stop = (restore = false) => {
clearTimer();
if (restore) index2.value = -1;
};
const restart = () => {
stop(true);
start();
};
if (reloadWhenDataChanged) watch(dataListComputed, () => restart());
useScopeDispose(stop);
return { data, index: index2, start, stop, restart };
};
// ../node_modules/vitepress-theme-teek/es/composables/useTextTypes.mjs
var useTextTypes = (data, options = {}) => {
const { inputTime = 200, outputTime = 100, nextTime = 800, shuffle = false, reloadWhenDataChanged = false } = options;
const dataComputed = computed(() => toValue(data) || []);
const text = ref("");
const isFinished = ref(false);
let originText = "";
let inputTimer;
let outputTimer;
let textIndex = 0;
let dataIndex = 0;
const clearInputTimer = () => {
if (inputTimer) {
clearInterval(inputTimer);
inputTimer = null;
}
};
const clearOutputTimer = () => {
if (outputTimer) {
clearInterval(outputTimer);
outputTimer = null;
}
};
const typesIn = () => {
isFinished.value = false;
originText = dataComputed.value[dataIndex];
if (!originText) return stop();
text.value = originText.substring(0, textIndex++);
if (textIndex > originText.length) {
clearInputTimer();
isFinished.value = true;
setTimeout(() => {
outputTimer = setInterval(() => {
typesOut();
}, outputTime);
}, nextTime);
}
};
const typesOut = () => {
if (textIndex >= 0) {
isFinished.value = false;
text.value = originText.substring(0, textIndex--);
} else {
clearOutputTimer();
isFinished.value = true;
setTimeout(() => {
if (shuffle) {
let newIndex;
do {
newIndex = Math.floor(Math.random() * dataComputed.value.length);
} while (newIndex === dataIndex);
dataIndex = newIndex;
} else {
dataIndex = (dataIndex + 1) % dataComputed.value.length;
}
inputTimer = setInterval(() => {
typesIn();
}, inputTime);
}, nextTime);
}
};
const start = () => {
isFinished.value = false;
inputTimer = setInterval(() => {
typesIn();
}, inputTime);
};
const stop = (restore = false) => {
clearInputTimer();
clearOutputTimer();
isFinished.value = false;
if (restore) {
text.value = "";
originText = "";
textIndex = 0;
dataIndex = 0;
}
};
const restart = () => {
stop(true);
start();
};
if (reloadWhenDataChanged) watch(dataComputed, () => restart());
useScopeDispose(stop);
return { text, isFinished, start, stop, restart };
};
// ../node_modules/vitepress-theme-teek/es/composables/useThemeColor.mjs
import { useData as useData2 } from "vitepress";
var vpBrand1 = "--vp-c-brand-1";
var vpBrand2 = "--vp-c-brand-2";
var vpBrand3 = "--vp-c-brand-3";
var vpBrandSoft = "--vp-c-brand-soft";
var vpBg = "--vp-c-bg";
var vpBgAlt = "--vp-c-bg-alt";
var vpBgSoft = "--vp-c-bg-soft";
var vpBgElv = "--vp-c-bg-elv";
var vpText1 = "--vp-c-text-1";
var vpText2 = "--vp-c-text-2";
var vpText3 = "--vp-c-text-3";
var tkBgColorElm = "--tk-bg-color-elm";
var tkBgColorMute = "--tk-bg-color-mute";
var varNameList = {
vpBrand1,
vpBrand2,
vpBrand3,
vpBrandSoft,
vpBg,
vpBgAlt,
vpBgSoft,
vpBgElv,
vpText1,
vpText2,
vpText3,
tkBgColorElm,
tkBgColorMute
};
var useThemeColor = (color, ignoreList) => {
const isSpread = ref(false);
const { isDark } = useData2();
const setStyleVar = (key, value) => {
if (!isClient) return;
document.documentElement.style.setProperty(key, value);
};
const removeStyleVar = (key) => {
if (!isClient) return;
document.documentElement.style.removeProperty(key);
};
const colorComputed = computed(() => toValue(color));
const clear = () => {
Object.values(varNameList).forEach((key) => {
removeStyleVar(key);
});
};
const switchLight = () => {
if (!isClient) return;
const primary = colorComputed.value;
if (!primary) return;
const lightVarDefaultMap = {
[vpBrand1]: primary,
[vpBrand2]: getLightColor(primary, 0.1),
[vpBrand3]: getLightColor(primary, 0.2),
[vpBrandSoft]: getLightColor(primary, 0.85)
};
const lightVarSpreadMap = {
[vpBg]: getLightColor(primary, 0.96),
[vpBgAlt]: getLightColor(primary, 0.93),
[vpBgElv]: getLightColor(primary, 0.945),
[vpBgSoft]: getLightColor(primary, 0.93),
[vpText1]: getDarkColor(primary, 0.6),
[vpText2]: getDarkColor(primary, 0.7),
[vpText3]: getLightColor(primary, 0.6),
[tkBgColorElm]: getLightColor(primary, 0.945),
[tkBgColorMute]: getLightColor(primary, 0.91)
};
const ignoreListConst = isFunction(ignoreList) ? ignoreList() : ignoreList || [];
Object.keys(lightVarDefaultMap).forEach((key) => {
if (ignoreListConst == null ? void 0 : ignoreListConst.includes(key)) return;
setStyleVar(key, lightVarDefaultMap[key]);
});
if (isSpread.value) {
Object.keys(lightVarSpreadMap).forEach((key) => {
if (ignoreListConst == null ? void 0 : ignoreListConst.includes(key)) return;
setStyleVar(key, lightVarSpreadMap[key]);
});
}
};
const switchDark = () => {
if (!isClient) return;
const primary = colorComputed.value;
if (!primary) return;
const darkVarDefaultMap = {
[vpBrand1]: primary,
[vpBrand2]: getDarkColor(primary, 0.1),
[vpBrand3]: getDarkColor(primary, 0.2),
[vpBrandSoft]: getDarkColor(primary, 0.85)
};
const darkVarSpreadMap = {
[vpBg]: getDarkColor(primary, 0.92),
[vpBgAlt]: getDarkColor(primary, 0.94),
[vpBgElv]: getDarkColor(primary, 0.92),
[vpBgSoft]: getDarkColor(primary, 0.94),
[vpText1]: getLightColor(primary, 0.9),
[tkBgColorElm]: getDarkColor(primary, 0.92),
[tkBgColorMute]: getDarkColor(primary, 0.91)
};
const ignoreListConst = isFunction(ignoreList) ? ignoreList() : ignoreList || [];
Object.keys(darkVarDefaultMap).forEach((key) => {
if (ignoreListConst == null ? void 0 : ignoreListConst.includes(key)) return;
setStyleVar(key, darkVarDefaultMap[key]);
});
if (isSpread.value) {
Object.keys(darkVarSpreadMap).forEach((key) => {
if (ignoreListConst == null ? void 0 : ignoreListConst.includes(key)) return;
setStyleVar(key, darkVarSpreadMap[key]);
});
}
};
const isStop = shallowRef(false);
let stopWatch = null;
const start = () => {
if (!isStop.value || !!stopWatch) return;
isStop.value = false;
update();
stopWatch = watch(isDark, update, { flush: "post" });
};
const update = () => {
if (isStop.value) return;
clear();
if (isDark.value) switchDark();
else switchLight();
};
const stop = () => {
stopWatch == null ? void 0 : stopWatch();
stopWatch = null;
isStop.value = true;
clear();
};
start();
watch(colorComputed, update);
watch(isSpread, () => {
stop();
start();
});
return {
isSpread: readonly(isSpread),
start,
stop,
update,
clear,
updateSpread: (value) => isSpread.value = value
};
};
// ../node_modules/vitepress-theme-teek/es/composables/useViewTransition.mjs
import { useData as useData3 } from "vitepress";
var useViewTransition = (options) => {
if (!isClient) return;
const {
enabled = true,
mode = "out-in",
duration = options.mode === "out-in" ? 300 : 600,
easing = "ease-in"
} = options;
if (!enabled) return;
const outIn = mode === "out-in";
const { isDark } = useData3();
document.documentElement.setAttribute("view-transition", mode);
const enableTransitions = () => "startViewTransition" in document && window.matchMedia("(prefers-reduced-motion: no-preference)").matches;
provide("toggle-appearance", async ({ clientX: x, clientY: y }) => {
if (!enableTransitions()) {
isDark.value = !isDark.value;
return;
}
const clipPath = [
`circle(0px at ${x}px ${y}px)`,
`circle(${Math.hypot(Math.max(x, innerWidth - x), Math.max(y, innerHeight - y))}px at ${x}px ${y}px)`
];
await document.startViewTransition(async () => {
isDark.value = !isDark.value;
await nextTick();
}).ready;
const isDarkCondition = outIn ? isDark.value : false;
document.documentElement.animate(
{ clipPath: isDarkCondition ? clipPath.reverse() : clipPath },
{
duration,
easing,
fill: "forwards",
pseudoElement: `::view-transition-${isDarkCondition ? "old" : "new"}(root)`
}
);
});
};
// ../node_modules/vitepress-theme-teek/es/composables/useVpRouter.mjs
import { useRouter } from "vitepress";
var useVpRouter = () => {
const router = useRouter();
const bindBeforeRouteChange = (stateFlag, bindFn, bindPosition = "after") => {
const { state = {}, onBeforeRouteChange } = router;
if (state[stateFlag]) return;
const beforeFn = bindPosition === "before" ? bindFn : onBeforeRouteChange;
const afterFn = bindPosition === "after" ? bindFn : onBeforeRouteChange;
router.onBeforeRouteChange = async (href) => {
const res = await (beforeFn == null ? void 0 : beforeFn(href));
if (res === false) return false;
return await (afterFn == null ? void 0 : afterFn(href));
};
router.state = { ...state, [stateFlag]: true };
};
const bindBeforePageLoad = (stateFlag, bindFn, bindPosition = "after") => {
const { state = {}, onBeforePageLoad } = router;
if (state[stateFlag]) return;
const beforeFn = bindPosition === "before" ? bindFn : onBeforePageLoad;
const afterFn = bindPosition === "after" ? bindFn : onBeforePageLoad;
router.onBeforePageLoad = async (href) => {
const res = await (beforeFn == null ? void 0 : beforeFn(href));
if (res === false) return false;
return await (afterFn == null ? void 0 : afterFn(href));
};
router.state = { ...state, [stateFlag]: true };
};
const bindAfterPageLoad = (stateFlag, bindFn, bindPosition = "after") => {
const { state = {}, onAfterPageLoad } = router;
if (state[stateFlag]) return;
const beforeFn = bindPosition === "before" ? bindFn : onAfterPageLoad;
const afterFn = bindPosition === "after" ? bindFn : onAfterPageLoad;
router.onAfterPageLoad = async (href) => {
await (beforeFn == null ? void 0 : beforeFn(href));
await (afterFn == null ? void 0 : afterFn(href));
};
router.state = { ...state, [stateFlag]: true };
};
const bindAfterRouteChange = (stateFlag, bindFn, bindPosition = "after") => {
const { state = {}, onAfterRouteChange } = router;
if (state[stateFlag]) return;
const beforeFn = bindPosition === "before" ? bindFn : onAfterRouteChange;
const afterFn = bindPosition === "after" ? bindFn : onAfterRouteChange;
router.onAfterRouteChange = async (href) => {
await (beforeFn == null ? void 0 : beforeFn(href));
await (afterFn == null ? void 0 : afterFn(href));
};
router.state = { ...state, [stateFlag]: true };
};
const bindRouterFn = (stateFlag, bindFn) => {
const { state = {} } = router;
if (state[stateFlag]) return;
bindFn(router);
router.state = { ...state, [stateFlag]: true };
};
return {
router,
route: router.route,
bindBeforeRouteChange,
bindBeforePageLoad,
bindAfterPageLoad,
bindAfterRouteChange,
bindRouterFn
};
};
// ../node_modules/vitepress-theme-teek/es/composables/useWindowTransition.mjs
var useWindowTransition = (element, immediate = true) => {
let startInMounted = false;
const cleanup = [];
const start = () => {
const elementConst = unref(element);
if (!elementConst) return;
if (isArray2(elementConst)) elementConst.forEach((el) => initTransition(el));
else initTransition(elementConst);
};
const initTransition = (el) => {
el.classList.add("scroll__animate");
const { create, clean } = useIntersectionObserver(
el,
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
requestAnimationFrame(() => {
try {
el.classList.add("visible");
clean();
} catch (error) {
console.error("初始化动画失败:", error);
}
});
}
});
},
0.1
);
create();
cleanup.push(clean);
};
const stop = () => {
cleanup.forEach((fn) => fn());
};
const restart = () => {
stop();
start();
};
watch(
() => unref(element),
() => {
!startInMounted && restart();
},
{ deep: true }
);
useMounted(async () => {
startInMounted = true;
immediate && restart();
await nextTick();
startInMounted = false;
});
useScopeDispose(stop);
return { start, stop, restart };
};
var useIntersectionObserver = (observerDom, callback, threshold) => {
let intersectionObserver = null;
const createIntersectionObserver = () => {
const observerDomValue = unref(observerDom);
if (intersectionObserver || !observerDomValue) return;
intersectionObserver = new IntersectionObserver(callback, { threshold });
intersectionObserver.observe(observerDomValue);
};
const cleanIntersectionObserver = () => {
if (intersectionObserver) {
intersectionObserver.disconnect();
intersectionObserver = null;
}
};
useScopeDispose(cleanIntersectionObserver);
return { create: createIntersectionObserver, clean: cleanIntersectionObserver };
};
// ../node_modules/vitepress-theme-teek/es/composables/useZIndex.mjs
var initial = {
current: 0
};
var zIndex = ref(0);
var defaultInitialZIndex = 2e3;
var Z_INDEX_INJECTION_KEY = Symbol("tkZIndexContextKey");
var zIndexContextKey = Symbol("zIndexContextKey");
var useZIndex = (zIndexOverrides) => {
const increasingInjection = getCurrentInstance() ? inject(Z_INDEX_INJECTION_KEY, initial) : initial;
const zIndexInjection = zIndexOverrides || (getCurrentInstance() ? inject(zIndexContextKey, void 0) : void 0);
const initialZIndex = computed(() => {
const zIndexFromInjection = zIndexInjection == null ? void 0 : zIndexInjection.value;
return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
});
const currentZIndex = computed(() => initialZIndex.value + zIndex.value);
const nextZIndex = () => {
increasingInjection.current++;
zIndex.value = increasingInjection.current;
return currentZIndex.value;
};
if (inject(Z_INDEX_INJECTION_KEY, void 0)) {
console.warn(
"ZIndexInjection",
`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`
);
}
return {
initialZIndex,
currentZIndex,
nextZIndex
};
};
// ../node_modules/vitepress-theme-teek/es/locale/lang/en.mjs
var en = {
lang: "en-US",
tk: {
archives: {
label: "Archive Page",
title: "Archive",
totalCount: "Total {count} articles",
year: "Year",
month: "Month",
count: "Articles",
notFound: "Not specified"
},
articleAnalyze: {
label: "Article Analysis",
wordCount: "Word Count",
readingTime: "Estimated Reading Time",
pageView: "Page Views"
},
articleAppreciation: {
label: "Article Appreciation",
contentLabel: "Appreciation Method"
},
articleBreadcrumb: {
label: "Article Breadcrumb",
home: "Home"
},
breadcrumb: {
label: "Breadcrumb"
},
articleInfo: {
label: "Article Information",
author: "Author",
createTime: "Create Time",
updateTime: "Update Time",
category: "Category",
tag: "Tag"
},
articleOverview: {
label: "Article Overview",
overview: " Overview",
category: " Category",
name: "Category",
title: "Title",
date: "Publish Time",
wordCount: "Word Count",
readingTime: "Reading Time"
},
articleShare: {
label: "Article Sharing",
text: "Share this page",
copiedText: "Link copied"
},
articleTitle: {
label: "Article Title"
},
articleUpdate: {
label: "Recent Update"
},
catalogue: {
label: "Catalogue Page",
title: "Table of Contents"
},
demoCode: {
playground: "Edit in Playground",
github: "Edit in GitHub",
copy: "Copy Code",
collapseSource: "View Source Code",
expandSource: "Hide Source Code",
notSupport: "Browser does not support copying",
copySuccess: "Copy successful",
copyFail: "Copy failed"
},
footerInfo: {
label: "Footer Information",
socialLabel: "Social Media",
infoLabel: "Footer Content"
},
home: {
label: "Home",
postLabel: "Article List",
cardLabel: "Sidebar Card Bar"
},
homeBanner: {
label: "Home Banner",
wavesLabel: "Home Banner Waves",
bgImgLabel: "Home Banner Background Image",
maskLabel: "Home Banner Mask Layer",
bgPureLabel: "Home Banner Background Color",
contentLabel: "Home Banner Content",
titleLabel: "Home Banner Title",
descLabel: "Home Banner Description",
descSwitchLabel: "Dynamic Description Switching",
descTypedLabel: "Typewriter Effect Description",
featureLabel: "Home Banner Features"
},
homePost: {
label: "Article List",
emptyLabel: "No articles available",
pageLabel: "Pagination Navigation",
moreLabel: "Read More >",
pin: "Sticky: {sticky}",
pinLabel: "Sticky Mark",
excerptLabel: "Article Summary",
infoLabel: "Article Information",
coverImgLabel: "Article Cover Image"
},
pageCard: {
label: "Home Card",
prev: "Previous Page",
next: "Next Page"
},
categoryCard: {
pageTitle: "{icon} All Categories",
homeTitle: "{icon} Article Categories",
label: "Home Category Card",
emptyLabel: "No categories available",
listLabel: "Category List",
moreLabel: "More ..."
},
docAnalysisCard: {
title: "{icon} Site Information",
totalPosts: "Number of Articles",
weekAddNum: "Added in the Last Week",
monthAddNum: "Added in the Last Month",
runtime: "Running Time",
totalWordCount: "Total Word Count",
lastActiveTime: "Last Activity Time",
viewCount: "This site has been visited",
visitCount: "This site has had visitors",
fileUnit: "Articles",
runtimeLess: "Less than a day",
runtimeUnit: "Days",
wordCountUnit: "Words",
viewCountUnit: "Times",
visitCountUnit: "People",
label: "Home Site Analysis Card"
},
friendLinkCard: {
title: "{icon} Friend Links",
emptyLabel: "No friend links available",
label: "Home Friend Link Card",
listLabel: "Friend Link List"
},
myCard: {
label: "My Information Card",
avatarAlt: "Blogger Avatar",
avatarTitle: "Do I look good?",
socialLabel: "Social Links",
bloggerLabel: "Blogger Information"
},
tagCard: {
pageTitle: "{icon} All Tags",
homeTitle: "{icon} Popular Tags",
label: "Home Tag Card",
emptyLabel: "No tags available",
listLabel: "Tag List",
moreLabel: "More ..."
},
topArticleCard: {
title: "{icon} Featured Articles",
label: "Home Featured Article Card",
emptyLabel: "No featured articles available",
listLabel: "Featured Article List"
},
image: {
error: "Failed to load"
},
notice: {
label: "Announcement Bar",
title: "Announcement",
openLabel: "Open Announcement Popup",
closeLabel: "Close Announcement Popup",
headLabel: "Announcement Header Area",
contentLabel: "Announcement Content"
},
pagination: {
goto: "Go to",
pagesize: "Items/Page",
total: "Total {total} items",
pageClassifier: "Page",
page: "Page",
prev: "Previous Page",
next: "Next Page",
currentPage: "Page {pager}",
prevPages: "Previous {pager} Pages",
nextPages: "Next {pager} Pages"
},
rightBottomButton: {
backTopTitle: "Back to Top",
themeSizeTitle: "Theme Size Switch",
themeStyleTitle: "Theme Style Switch",
toComment: "Go to Comment"
},
themeEnhance: {
title: "Theme Enhancement",
layoutSwitch: {
title: "Layout Switch",
helpDesc: "Adjust VitePress layout styles to adapt to different reading habits and screen environments.",
fullWidthTipTitle: "Full Width",
fullWidthHelpTipContent: "Make the sidebar and content area occupy the full width of the screen.",
sidebarWidthAdjustableOnlyTipTitle: "Full Width, but Sidebar Width Adjustable",
sidebarWidthAdjustableOnlyHelpTipContent: "The sidebar width is adjustable, but the content area width remains unchanged. The adjusted sidebar can occupy the maximum width of the screen.",
bothWidthAdjustableTipTitle: "Full Width, and Both Sidebar and Content Area Widths Adjustable",
bothWidthAdjustableHelpTipContent: "Both the sidebar and content area widths are adjustable. The adjusted sidebar and content area can occupy the maximum width of the screen.",
originalWidthTipTitle: "Original Width",
originalWidthHelpTipContent: "The original default VitePress layout width."
},
docLayoutMaxWidth: {
title: "Document Content Maximum Width",
helpDesc: "Adjust the width of the document content area in the VitePress layout to adapt to different reading habits and screen environments.",
helpTipTitle: "Adjust Document Content Maximum Width",
helpTipContent: "A slider to select and customize the maximum width of the document content."
},
pageLayoutMaxWidth: {
title: "Page Maximum Width",
helpDesc: "Adjust the width of the page in the VitePress layout to adapt to different reading habits and screen environments.",
helpTipTitle: "Adjust Page Maximum Width",
helpTipContent: "A slider to select and customize the maximum width of the page."
},
themeColor: {
title: "Layout Theme Color",
speedLabel: "Speed",
vpLabel: "VitePress Theme",
epLabel: "ElementPlus Theme",
vpTip: "VitePress Theme",
epTip: "ElementPlus Theme",
defaultLabel: "Default",
blueLabel: "Blue",
greenLabel: "Green",
yellowLabel: "Yellow",
redLabel: "Red",
helpDesc: "Provide VitePress base color palette and ElementPlus base color palette for selection. The theme color can be diffused to other elements such as sidebar background color, font color, etc. through the diffusion switch.",
vpHelpTipTitle: "VitePress Base Color Palette",
vpHelpTipContent: "Provides 4 VitePress base color palettes: Blue (default), Green, Yellow, Red.",
epHelpTipTitle: "ElementPlus Base Color Palette",
epHelpTipContent: "Provides 4 ElementPlus base color palettes: Blue, Green, Yellow, Red."
},
spotlight: {
title: "Spotlight",
helpDesc: "Highlight the current line or element under the mouse pointer in the main text to optimize the reading experience for users with focus difficulties.",
onTipTitle: "Enable",
onHelpTipContent: "Turn on the spotlight.",
offTipTitle: "Disable",
offHelpTipContent: "Turn off the spotlight."
},
spotlightStyles: {
title: "Spotlight Styles",
helpDesc: "Adjust the style of the spotlight.",
asideTipTitle: "Place Aside",
asideHelpTipContent: "Add a fixed solid line next to the current element under the mouse pointer to highlight its position.",
underTipTitle: "Place Under",
underHelpTipContent: "Add a solid background below the current element under the mouse pointer to highlight its position."
}
},
login: {
label: "Login Page",
reset: "Reset",
login: "Login",
loginSuccess: "Login succeeded!",
loginError: "Username or password incorrect!",
loginInfoNull: "Please input your username and password!",
usernamePlaceholder: "Please input a username",
passwordPlaceholder: "Please input a password",
verifyCodePlaceholder: "Please input the verification code",
verifyCodeNonNull: "Please input the verification code",
verifyCodeError: "Please input the correct verification code"
},
riskLink: {
label: "Risk Link Page",
title: "Leaving {name} soon, please pay attention to property safety",
linkIllegal: "Link security verification in progress, please wait ...",
confirmButtonText: "Continue to visit"
},
sidebarTrigger: {
label: "Sidebar expand/collapse"
}
}
};
// ../node_modules/markdown-it-container/index.mjs
function container_plugin(md, name, options) {
function validateDefault(params) {
return params.trim().split(" ", 2)[0] === name;
}
function renderDefault(tokens, idx, _options, env, slf) {
if (tokens[idx].nesting === 1) {
tokens[idx].attrJoin("class", name);
}
return slf.renderToken(tokens, idx, _options, env, slf);
}
options = options || {};
const min_markers = 3;
const marker_str = options.marker || ":";
const marker_char = marker_str.charCodeAt(0);
const marker_len = marker_str.length;
const validate = options.validate || validateDefault;
const render3 = options.render || renderDefault;
function container(state, startLine, endLine, silent) {
let pos;
let auto_closed = false;
let start = state.bMarks[startLine] + state.tShift[startLine];
let max = state.eMarks[startLine];
if (marker_char !== state.src.charCodeAt(start)) {
return false;
}
for (pos = start + 1; pos <= max; pos++) {
if (marker_str[(pos - start) % marker_len] !== state.src[pos]) {
break;
}
}
const marker_count = Math.floor((pos - start) / marker_len);
if (marker_count < min_markers) {
return false;
}
pos -= (pos - start) % marker_len;
const markup = state.src.slice(start, pos);
const params = state.src.slice(pos, max);
if (!validate(params, markup)) {
return false;
}
if (silent) {
return true;
}
let nextLine = startLine;
for (; ; ) {
nextLine++;
if (nextLine >= endLine) {
break;
}
start = state.bMarks[nextLine] + state.tShift[nextLine];
max = state.eMarks[nextLine];
if (start < max && state.sCount[nextLine] < state.blkIndent) {
break;
}
if (marker_char !== state.src.charCodeAt(start)) {
continue;
}
if (state.sCount[nextLine] - state.blkIndent >= 4) {
continue;
}
for (pos = start + 1; pos <= max; pos++) {
if (marker_str[(pos - start) % marker_len] !== state.src[pos]) {
break;
}
}
if (Math.floor((pos - start) / marker_len) < marker_count) {
continue;
}
pos -= (pos - start) % marker_len;
pos = state.skipSpaces(pos);
if (pos < max) {
continue;
}
auto_closed = true;
break;
}
const old_parent = state.parentType;
const old_line_max = state.lineMax;
state.parentType = "container";
state.lineMax = nextLine;
const token_o = state.push("container_" + name + "_open", "div", 1);
token_o.markup = markup;
token_o.block = true;
token_o.info = params;
token_o.map = [startLine, nextLine];
state.md.block.tokenize(state, startLine + 1, nextLine);
const token_c = state.push("container_" + name + "_close", "div", -1);
token_c.markup = state.src.slice(start, pos);
token_c.block = true;
state.parentType = old_parent;
state.lineMax = old_line_max;
state.line = nextLine + (auto_closed ? 1 : 0);
return true;
}
md.block.ruler.before("fence", "container_" + name, container, {
alt: ["paragraph", "reference", "blockquote", "list"]
});
md.renderer.rules["container_" + name + "_open"] = render3;
md.renderer.rules["container_" + name + "_close"] = render3;
}
// ../node_modules/vitepress-theme-teek/es/markdown/helper/simpleContainer.mjs
var createContainerThenUse = (md, option) => {
md.use(...createContainerThenGet(md, option));
};
var createContainerThenGet = (md, option) => {
const { type: type2, useTitle, defaultTitle, className } = option;
return [
container_plugin,
type2,
{
render(tokens, idx) {
const token = tokens[idx];
const info = token.info.trim().slice(type2.length).trim();
if (token.nesting === 1) {
const title = useTitle ? md.renderInline(info || defaultTitle || "") : "";
return `${useTitle ? `
${title}
` : ""}
`;
} else return `
`;
}
}
];
};
var createContainersThenUse = (md, options) => {
options.forEach((option) => {
md.use(...createContainerThenGet(md, option));
});
};
var createContainersThenGet = (md, options) => {
const containers = [];
options.forEach((option) => {
containers.push(createContainerThenGet(md, option));
});
return containers;
};
// ../node_modules/js-yaml/dist/js-yaml.mjs
function isNothing(subject) {
return typeof subject === "undefined" || subject === null;
}
function isObject3(subject) {
return typeof subject === "object" && subject !== null;
}
function toArray(sequence) {
if (Array.isArray(sequence)) return sequence;
else if (isNothing(sequence)) return [];
return [sequence];
}
function extend2(target, source) {
var index2, length, key, sourceKeys;
if (source) {
sourceKeys = Object.keys(source);
for (index2 = 0, length = sourceKeys.length; index2 < length; index2 += 1) {
key = sourceKeys[index2];
target[key] = source[key];
}
}
return target;
}
function repeat(string, count) {
var result = "", cycle;
for (cycle = 0; cycle < count; cycle += 1) {
result += string;
}
return result;
}
function isNegativeZero(number) {
return number === 0 && Number.NEGATIVE_INFINITY === 1 / number;
}
var isNothing_1 = isNothing;
var isObject_1 = isObject3;
var toArray_1 = toArray;
var repeat_1 = repeat;
var isNegativeZero_1 = isNegativeZero;
var extend_1 = extend2;
var common = {
isNothing: isNothing_1,
isObject: isObject_1,
toArray: toArray_1,
repeat: repeat_1,
isNegativeZero: isNegativeZero_1,
extend: extend_1
};
function formatError(exception2, compact) {
var where = "", message2 = exception2.reason || "(unknown reason)";
if (!exception2.mark) return message2;
if (exception2.mark.name) {
where += 'in "' + exception2.mark.name + '" ';
}
where += "(" + (exception2.mark.line + 1) + ":" + (exception2.mark.column + 1) + ")";
if (!compact && exception2.mark.snippet) {
where += "\n\n" + exception2.mark.snippet;
}
return message2 + " " + where;
}
function YAMLException$1(reason, mark) {
Error.call(this);
this.name = "YAMLException";
this.reason = reason;
this.mark = mark;
this.message = formatError(this, false);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = new Error().stack || "";
}
}
YAMLException$1.prototype = Object.create(Error.prototype);
YAMLException$1.prototype.constructor = YAMLException$1;
YAMLException$1.prototype.toString = function toString(compact) {
return this.name + ": " + formatError(this, compact);
};
var exception = YAMLException$1;
function getLine(buffer, lineStart, lineEnd, position, maxLineLength) {
var head = "";
var tail = "";
var maxHalfLength = Math.floor(maxLineLength / 2) - 1;
if (position - lineStart > maxHalfLength) {
head = " ... ";
lineStart = position - maxHalfLength + head.length;
}
if (lineEnd - position > maxHalfLength) {
tail = " ...";
lineEnd = position + maxHalfLength - tail.length;
}
return {
str: head + buffer.slice(lineStart, lineEnd).replace(/\t/g, "→") + tail,
pos: position - lineStart + head.length
// relative position
};
}
function padStart(string, max) {
return common.repeat(" ", max - string.length) + string;
}
function makeSnippet(mark, options) {
options = Object.create(options || null);
if (!mark.buffer) return null;
if (!options.maxLength) options.maxLength = 79;
if (typeof options.indent !== "number") options.indent = 1;
if (typeof options.linesBefore !== "number") options.linesBefore = 3;
if (typeof options.linesAfter !== "number") options.linesAfter = 2;
var re = /\r?\n|\r|\0/g;
var lineStarts = [0];
var lineEnds = [];
var match;
var foundLineNo = -1;
while (match = re.exec(mark.buffer)) {
lineEnds.push(match.index);
lineStarts.push(match.index + match[0].length);
if (mark.position <= match.index && foundLineNo < 0) {
foundLineNo = lineStarts.length - 2;
}
}
if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;
var result = "", i, line;
var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;
var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);
for (i = 1; i <= options.linesBefore; i++) {
if (foundLineNo - i < 0) break;
line = getLine(
mark.buffer,
lineStarts[foundLineNo - i],
lineEnds[foundLineNo - i],
mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),
maxLineLength
);
result = common.repeat(" ", options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) + " | " + line.str + "\n" + result;
}
line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);
result += common.repeat(" ", options.indent) + padStart((mark.line + 1).toString(), lineNoLength) + " | " + line.str + "\n";
result += common.repeat("-", options.indent + lineNoLength + 3 + line.pos) + "^\n";
for (i = 1; i <= options.linesAfter; i++) {
if (foundLineNo + i >= lineEnds.length) break;
line = getLine(
mark.buffer,
lineStarts[foundLineNo + i],
lineEnds[foundLineNo + i],
mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),
maxLineLength
);
result += common.repeat(" ", options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) + " | " + line.str + "\n";
}
return result.replace(/\n$/, "");
}
var snippet = makeSnippet;
var TYPE_CONSTRUCTOR_OPTIONS = [
"kind",
"multi",
"resolve",
"construct",
"instanceOf",
"predicate",
"represent",
"representName",
"defaultStyle",
"styleAliases"
];
var YAML_NODE_KINDS = [
"scalar",
"sequence",
"mapping"
];
function compileStyleAliases(map2) {
var result = {};
if (map2 !== null) {
Object.keys(map2).forEach(function(style) {
map2[style].forEach(function(alias) {
result[String(alias)] = style;
});
});
}
return result;
}
function Type$1(tag, options) {
options = options || {};
Object.keys(options).forEach(function(name) {
if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
throw new exception('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
}
});
this.options = options;
this.tag = tag;
this.kind = options["kind"] || null;
this.resolve = options["resolve"] || function() {
return true;
};
this.construct = options["construct"] || function(data) {
return data;
};
this.instanceOf = options["instanceOf"] || null;
this.predicate = options["predicate"] || null;
this.represent = options["represent"] || null;
this.representName = options["representName"] || null;
this.defaultStyle = options["defaultStyle"] || null;
this.multi = options["multi"] || false;
this.styleAliases = compileStyleAliases(options["styleAliases"] || null);
if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
throw new exception('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
}
}
var type = Type$1;
function compileList(schema2, name) {
var result = [];
schema2[name].forEach(function(currentType) {
var newIndex = result.length;
result.forEach(function(previousType, previousIndex) {
if (previousType.tag === currentType.tag && previousType.kind === currentType.kind && previousType.multi === currentType.multi) {
newIndex = previousIndex;
}
});
result[newIndex] = currentType;
});
return result;
}
function compileMap() {
var result = {
scalar: {},
sequence: {},
mapping: {},
fallback: {},
multi: {
scalar: [],
sequence: [],
mapping: [],
fallback: []
}
}, index2, length;
function collectType(type2) {
if (type2.multi) {
result.multi[type2.kind].push(type2);
result.multi["fallback"].push(type2);
} else {
result[type2.kind][type2.tag] = result["fallback"][type2.tag] = type2;
}
}
for (index2 = 0, length = arguments.length; index2 < length; index2 += 1) {
arguments[index2].forEach(collectType);
}
return result;
}
function Schema$1(definition) {
return this.extend(definition);
}
Schema$1.prototype.extend = function extend3(definition) {
var implicit = [];
var explicit = [];
if (definition instanceof type) {
explicit.push(definition);
} else if (Array.isArray(definition)) {
explicit = explicit.concat(definition);
} else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {
if (definition.implicit) implicit = implicit.concat(definition.implicit);
if (definition.explicit) explicit = explicit.concat(definition.explicit);
} else {
throw new exception("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
}
implicit.forEach(function(type$1) {
if (!(type$1 instanceof type)) {
throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
}
if (type$1.loadKind && type$1.loadKind !== "scalar") {
throw new exception("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
}
if (type$1.multi) {
throw new exception("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
}
});
explicit.forEach(function(type$1) {
if (!(type$1 instanceof type)) {
throw new exception("Specified list of YAML types (or a single Type object) contains a non-Type object.");
}
});
var result = Object.create(Schema$1.prototype);
result.implicit = (this.implicit || []).concat(implicit);
result.explicit = (this.explicit || []).concat(explicit);
result.compiledImplicit = compileList(result, "implicit");
result.compiledExplicit = compileList(result, "explicit");
result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);
return result;
};
var schema = Schema$1;
var str = new type("tag:yaml.org,2002:str", {
kind: "scalar",
construct: function(data) {
return data !== null ? data : "";
}
});
var seq = new type("tag:yaml.org,2002:seq", {
kind: "sequence",
construct: function(data) {
return data !== null ? data : [];
}
});
var map = new type("tag:yaml.org,2002:map", {
kind: "mapping",
construct: function(data) {
return data !== null ? data : {};
}
});
var failsafe = new schema({
explicit: [
str,
seq,
map
]
});
function resolveYamlNull(data) {
if (data === null) return true;
var max = data.length;
return max === 1 && data === "~" || max === 4 && (data === "null" || data === "Null" || data === "NULL");
}
function constructYamlNull() {
return null;
}
function isNull2(object) {
return object === null;
}
var _null = new type("tag:yaml.org,2002:null", {
kind: "scalar",
resolve: resolveYamlNull,
construct: constructYamlNull,
predicate: isNull2,
represent: {
canonical: function() {
return "~";
},
lowercase: function() {
return "null";
},
uppercase: function() {
return "NULL";
},
camelcase: function() {
return "Null";
},
empty: function() {
return "";
}
},
defaultStyle: "lowercase"
});
function resolveYamlBoolean(data) {
if (data === null) return false;
var max = data.length;
return max === 4 && (data === "true" || data === "True" || data === "TRUE") || max === 5 && (data === "false" || data === "False" || data === "FALSE");
}
function constructYamlBoolean(data) {
return data === "true" || data === "True" || data === "TRUE";
}
function isBoolean2(object) {
return Object.prototype.toString.call(object) === "[object Boolean]";
}
var bool = new type("tag:yaml.org,2002:bool", {
kind: "scalar",
resolve: resolveYamlBoolean,
construct: constructYamlBoolean,
predicate: isBoolean2,
represent: {
lowercase: function(object) {
return object ? "true" : "false";
},
uppercase: function(object) {
return object ? "TRUE" : "FALSE";
},
camelcase: function(object) {
return object ? "True" : "False";
}
},
defaultStyle: "lowercase"
});
function isHexCode(c) {
return 48 <= c && c <= 57 || 65 <= c && c <= 70 || 97 <= c && c <= 102;
}
function isOctCode(c) {
return 48 <= c && c <= 55;
}
function isDecCode(c) {
return 48 <= c && c <= 57;
}
function resolveYamlInteger(data) {
if (data === null) return false;
var max = data.length, index2 = 0, hasDigits = false, ch;
if (!max) return false;
ch = data[index2];
if (ch === "-" || ch === "+") {
ch = data[++index2];
}
if (ch === "0") {
if (index2 + 1 === max) return true;
ch = data[++index2];
if (ch === "b") {
index2++;
for (; index2 < max; index2++) {
ch = data[index2];
if (ch === "_") continue;
if (ch !== "0" && ch !== "1") return false;
hasDigits = true;
}
return hasDigits && ch !== "_";
}
if (ch === "x") {
index2++;
for (; index2 < max; index2++) {
ch = data[index2];
if (ch === "_") continue;
if (!isHexCode(data.charCodeAt(index2))) return false;
hasDigits = true;
}
return hasDigits && ch !== "_";
}
if (ch === "o") {
index2++;
for (; index2 < max; index2++) {
ch = data[index2];
if (ch === "_") continue;
if (!isOctCode(data.charCodeAt(index2))) return false;
hasDigits = true;
}
return hasDigits && ch !== "_";
}
}
if (ch === "_") return false;
for (; index2 < max; index2++) {
ch = data[index2];
if (ch === "_") continue;
if (!isDecCode(data.charCodeAt(index2))) {
return false;
}
hasDigits = true;
}
if (!hasDigits || ch === "_") return false;
return true;
}
function constructYamlInteger(data) {
var value = data, sign = 1, ch;
if (value.indexOf("_") !== -1) {
value = value.replace(/_/g, "");
}
ch = value[0];
if (ch === "-" || ch === "+") {
if (ch === "-") sign = -1;
value = value.slice(1);
ch = value[0];
}
if (value === "0") return 0;
if (ch === "0") {
if (value[1] === "b") return sign * parseInt(value.slice(2), 2);
if (value[1] === "x") return sign * parseInt(value.slice(2), 16);
if (value[1] === "o") return sign * parseInt(value.slice(2), 8);
}
return sign * parseInt(value, 10);
}
function isInteger(object) {
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 === 0 && !common.isNegativeZero(object));
}
var int = new type("tag:yaml.org,2002:int", {
kind: "scalar",
resolve: resolveYamlInteger,
construct: constructYamlInteger,
predicate: isInteger,
represent: {
binary: function(obj) {
return obj >= 0 ? "0b" + obj.toString(2) : "-0b" + obj.toString(2).slice(1);
},
octal: function(obj) {
return obj >= 0 ? "0o" + obj.toString(8) : "-0o" + obj.toString(8).slice(1);
},
decimal: function(obj) {
return obj.toString(10);
},
/* eslint-disable max-len */
hexadecimal: function(obj) {
return obj >= 0 ? "0x" + obj.toString(16).toUpperCase() : "-0x" + obj.toString(16).toUpperCase().slice(1);
}
},
defaultStyle: "decimal",
styleAliases: {
binary: [2, "bin"],
octal: [8, "oct"],
decimal: [10, "dec"],
hexadecimal: [16, "hex"]
}
});
var YAML_FLOAT_PATTERN = new RegExp(
// 2.5e4, 2.5 and integers
"^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"
);
function resolveYamlFloat(data) {
if (data === null) return false;
if (!YAML_FLOAT_PATTERN.test(data) || // Quick hack to not allow integers end with `_`
// Probably should update regexp & check speed
data[data.length - 1] === "_") {
return false;
}
return true;
}
function constructYamlFloat(data) {
var value, sign;
value = data.replace(/_/g, "").toLowerCase();
sign = value[0] === "-" ? -1 : 1;
if ("+-".indexOf(value[0]) >= 0) {
value = value.slice(1);
}
if (value === ".inf") {
return sign === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
} else if (value === ".nan") {
return NaN;
}
return sign * parseFloat(value, 10);
}
var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
function representYamlFloat(object, style) {
var res;
if (isNaN(object)) {
switch (style) {
case "lowercase":
return ".nan";
case "uppercase":
return ".NAN";
case "camelcase":
return ".NaN";
}
} else if (Number.POSITIVE_INFINITY === object) {
switch (style) {
case "lowercase":
return ".inf";
case "uppercase":
return ".INF";
case "camelcase":
return ".Inf";
}
} else if (Number.NEGATIVE_INFINITY === object) {
switch (style) {
case "lowercase":
return "-.inf";
case "uppercase":
return "-.INF";
case "camelcase":
return "-.Inf";
}
} else if (common.isNegativeZero(object)) {
return "-0.0";
}
res = object.toString(10);
return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace("e", ".e") : res;
}
function isFloat(object) {
return Object.prototype.toString.call(object) === "[object Number]" && (object % 1 !== 0 || common.isNegativeZero(object));
}
var float = new type("tag:yaml.org,2002:float", {
kind: "scalar",
resolve: resolveYamlFloat,
construct: constructYamlFloat,
predicate: isFloat,
represent: representYamlFloat,
defaultStyle: "lowercase"
});
var json = failsafe.extend({
implicit: [
_null,
bool,
int,
float
]
});
var core = json;
var YAML_DATE_REGEXP = new RegExp(
"^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"
);
var YAML_TIMESTAMP_REGEXP = new RegExp(
"^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$"
);
function resolveYamlTimestamp(data) {
if (data === null) return false;
if (YAML_DATE_REGEXP.exec(data) !== null) return true;
if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
return false;
}
function constructYamlTimestamp(data) {
var match, year, month, day, hour, minute, second, fraction = 0, delta = null, tz_hour, tz_minute, date;
match = YAML_DATE_REGEXP.exec(data);
if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
if (match === null) throw new Error("Date resolve error");
year = +match[1];
month = +match[2] - 1;
day = +match[3];
if (!match[4]) {
return new Date(Date.UTC(year, month, day));
}
hour = +match[4];
minute = +match[5];
second = +match[6];
if (match[7]) {
fraction = match[7].slice(0, 3);
while (fraction.length < 3) {
fraction += "0";
}
fraction = +fraction;
}
if (match[9]) {
tz_hour = +match[10];
tz_minute = +(match[11] || 0);
delta = (tz_hour * 60 + tz_minute) * 6e4;
if (match[9] === "-") delta = -delta;
}
date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
if (delta) date.setTime(date.getTime() - delta);
return date;
}
function representYamlTimestamp(object) {
return object.toISOString();
}
var timestamp = new type("tag:yaml.org,2002:timestamp", {
kind: "scalar",
resolve: resolveYamlTimestamp,
construct: constructYamlTimestamp,
instanceOf: Date,
represent: representYamlTimestamp
});
function resolveYamlMerge(data) {
return data === "<<" || data === null;
}
var merge = new type("tag:yaml.org,2002:merge", {
kind: "scalar",
resolve: resolveYamlMerge
});
var BASE64_MAP = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";
function resolveYamlBinary(data) {
if (data === null) return false;
var code, idx, bitlen = 0, max = data.length, map2 = BASE64_MAP;
for (idx = 0; idx < max; idx++) {
code = map2.indexOf(data.charAt(idx));
if (code > 64) continue;
if (code < 0) return false;
bitlen += 6;
}
return bitlen % 8 === 0;
}
function constructYamlBinary(data) {
var idx, tailbits, input = data.replace(/[\r\n=]/g, ""), max = input.length, map2 = BASE64_MAP, bits = 0, result = [];
for (idx = 0; idx < max; idx++) {
if (idx % 4 === 0 && idx) {
result.push(bits >> 16 & 255);
result.push(bits >> 8 & 255);
result.push(bits & 255);
}
bits = bits << 6 | map2.indexOf(input.charAt(idx));
}
tailbits = max % 4 * 6;
if (tailbits === 0) {
result.push(bits >> 16 & 255);
result.push(bits >> 8 & 255);
result.push(bits & 255);
} else if (tailbits === 18) {
result.push(bits >> 10 & 255);
result.push(bits >> 2 & 255);
} else if (tailbits === 12) {
result.push(bits >> 4 & 255);
}
return new Uint8Array(result);
}
function representYamlBinary(object) {
var result = "", bits = 0, idx, tail, max = object.length, map2 = BASE64_MAP;
for (idx = 0; idx < max; idx++) {
if (idx % 3 === 0 && idx) {
result += map2[bits >> 18 & 63];
result += map2[bits >> 12 & 63];
result += map2[bits >> 6 & 63];
result += map2[bits & 63];
}
bits = (bits << 8) + object[idx];
}
tail = max % 3;
if (tail === 0) {
result += map2[bits >> 18 & 63];
result += map2[bits >> 12 & 63];
result += map2[bits >> 6 & 63];
result += map2[bits & 63];
} else if (tail === 2) {
result += map2[bits >> 10 & 63];
result += map2[bits >> 4 & 63];
result += map2[bits << 2 & 63];
result += map2[64];
} else if (tail === 1) {
result += map2[bits >> 2 & 63];
result += map2[bits << 4 & 63];
result += map2[64];
result += map2[64];
}
return result;
}
function isBinary(obj) {
return Object.prototype.toString.call(obj) === "[object Uint8Array]";
}
var binary = new type("tag:yaml.org,2002:binary", {
kind: "scalar",
resolve: resolveYamlBinary,
construct: constructYamlBinary,
predicate: isBinary,
represent: representYamlBinary
});
var _hasOwnProperty$3 = Object.prototype.hasOwnProperty;
var _toString$2 = Object.prototype.toString;
function resolveYamlOmap(data) {
if (data === null) return true;
var objectKeys = [], index2, length, pair, pairKey, pairHasKey, object = data;
for (index2 = 0, length = object.length; index2 < length; index2 += 1) {
pair = object[index2];
pairHasKey = false;
if (_toString$2.call(pair) !== "[object Object]") return false;
for (pairKey in pair) {
if (_hasOwnProperty$3.call(pair, pairKey)) {
if (!pairHasKey) pairHasKey = true;
else return false;
}
}
if (!pairHasKey) return false;
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
else return false;
}
return true;
}
function constructYamlOmap(data) {
return data !== null ? data : [];
}
var omap = new type("tag:yaml.org,2002:omap", {
kind: "sequence",
resolve: resolveYamlOmap,
construct: constructYamlOmap
});
var _toString$1 = Object.prototype.toString;
function resolveYamlPairs(data) {
if (data === null) return true;
var index2, length, pair, keys, result, object = data;
result = new Array(object.length);
for (index2 = 0, length = object.length; index2 < length; index2 += 1) {
pair = object[index2];
if (_toString$1.call(pair) !== "[object Object]") return false;
keys = Object.keys(pair);
if (keys.length !== 1) return false;
result[index2] = [keys[0], pair[keys[0]]];
}
return true;
}
function constructYamlPairs(data) {
if (data === null) return [];
var index2, length, pair, keys, result, object = data;
result = new Array(object.length);
for (index2 = 0, length = object.length; index2 < length; index2 += 1) {
pair = object[index2];
keys = Object.keys(pair);
result[index2] = [keys[0], pair[keys[0]]];
}
return result;
}
var pairs = new type("tag:yaml.org,2002:pairs", {
kind: "sequence",
resolve: resolveYamlPairs,
construct: constructYamlPairs
});
var _hasOwnProperty$2 = Object.prototype.hasOwnProperty;
function resolveYamlSet(data) {
if (data === null) return true;
var key, object = data;
for (key in object) {
if (_hasOwnProperty$2.call(object, key)) {
if (object[key] !== null) return false;
}
}
return true;
}
function constructYamlSet(data) {
return data !== null ? data : {};
}
var set = new type("tag:yaml.org,2002:set", {
kind: "mapping",
resolve: resolveYamlSet,
construct: constructYamlSet
});
var _default = core.extend({
implicit: [
timestamp,
merge
],
explicit: [
binary,
omap,
pairs,
set
]
});
var _hasOwnProperty$1 = Object.prototype.hasOwnProperty;
var CONTEXT_FLOW_IN = 1;
var CONTEXT_FLOW_OUT = 2;
var CONTEXT_BLOCK_IN = 3;
var CONTEXT_BLOCK_OUT = 4;
var CHOMPING_CLIP = 1;
var CHOMPING_STRIP = 2;
var CHOMPING_KEEP = 3;
var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
function _class(obj) {
return Object.prototype.toString.call(obj);
}
function is_EOL(c) {
return c === 10 || c === 13;
}
function is_WHITE_SPACE(c) {
return c === 9 || c === 32;
}
function is_WS_OR_EOL(c) {
return c === 9 || c === 32 || c === 10 || c === 13;
}
function is_FLOW_INDICATOR(c) {
return c === 44 || c === 91 || c === 93 || c === 123 || c === 125;
}
function fromHexCode(c) {
var lc;
if (48 <= c && c <= 57) {
return c - 48;
}
lc = c | 32;
if (97 <= lc && lc <= 102) {
return lc - 97 + 10;
}
return -1;
}
function escapedHexLen(c) {
if (c === 120) {
return 2;
}
if (c === 117) {
return 4;
}
if (c === 85) {
return 8;
}
return 0;
}
function fromDecimalCode(c) {
if (48 <= c && c <= 57) {
return c - 48;
}
return -1;
}
function simpleEscapeSequence(c) {
return c === 48 ? "\0" : c === 97 ? "\x07" : c === 98 ? "\b" : c === 116 ? " " : c === 9 ? " " : c === 110 ? "\n" : c === 118 ? "\v" : c === 102 ? "\f" : c === 114 ? "\r" : c === 101 ? "\x1B" : c === 32 ? " " : c === 34 ? '"' : c === 47 ? "/" : c === 92 ? "\\" : c === 78 ? "
" : c === 95 ? " " : c === 76 ? "\u2028" : c === 80 ? "\u2029" : "";
}
function charFromCodepoint(c) {
if (c <= 65535) {
return String.fromCharCode(c);
}
return String.fromCharCode(
(c - 65536 >> 10) + 55296,
(c - 65536 & 1023) + 56320
);
}
function setProperty(object, key, value) {
if (key === "__proto__") {
Object.defineProperty(object, key, {
configurable: true,
enumerable: true,
writable: true,
value
});
} else {
object[key] = value;
}
}
var simpleEscapeCheck = new Array(256);
var simpleEscapeMap = new Array(256);
for (i = 0; i < 256; i++) {
simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
simpleEscapeMap[i] = simpleEscapeSequence(i);
}
var i;
function State$1(input, options) {
this.input = input;
this.filename = options["filename"] || null;
this.schema = options["schema"] || _default;
this.onWarning = options["onWarning"] || null;
this.legacy = options["legacy"] || false;
this.json = options["json"] || false;
this.listener = options["listener"] || null;
this.implicitTypes = this.schema.compiledImplicit;
this.typeMap = this.schema.compiledTypeMap;
this.length = input.length;
this.position = 0;
this.line = 0;
this.lineStart = 0;
this.lineIndent = 0;
this.firstTabInLine = -1;
this.documents = [];
}
function generateError(state, message2) {
var mark = {
name: state.filename,
buffer: state.input.slice(0, -1),
// omit trailing \0
position: state.position,
line: state.line,
column: state.position - state.lineStart
};
mark.snippet = snippet(mark);
return new exception(message2, mark);
}
function throwError(state, message2) {
throw generateError(state, message2);
}
function throwWarning(state, message2) {
if (state.onWarning) {
state.onWarning.call(null, generateError(state, message2));
}
}
var directiveHandlers = {
YAML: function handleYamlDirective(state, name, args) {
var match, major, minor;
if (state.version !== null) {
throwError(state, "duplication of %YAML directive");
}
if (args.length !== 1) {
throwError(state, "YAML directive accepts exactly one argument");
}
match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
if (match === null) {
throwError(state, "ill-formed argument of the YAML directive");
}
major = parseInt(match[1], 10);
minor = parseInt(match[2], 10);
if (major !== 1) {
throwError(state, "unacceptable YAML version of the document");
}
state.version = args[0];
state.checkLineBreaks = minor < 2;
if (minor !== 1 && minor !== 2) {
throwWarning(state, "unsupported YAML version of the document");
}
},
TAG: function handleTagDirective(state, name, args) {
var handle, prefix;
if (args.length !== 2) {
throwError(state, "TAG directive accepts exactly two arguments");
}
handle = args[0];
prefix = args[1];
if (!PATTERN_TAG_HANDLE.test(handle)) {
throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
}
if (_hasOwnProperty$1.call(state.tagMap, handle)) {
throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
}
if (!PATTERN_TAG_URI.test(prefix)) {
throwError(state, "ill-formed tag prefix (second argument) of the TAG directive");
}
try {
prefix = decodeURIComponent(prefix);
} catch (err) {
throwError(state, "tag prefix is malformed: " + prefix);
}
state.tagMap[handle] = prefix;
}
};
function captureSegment(state, start, end, checkJson) {
var _position, _length, _character, _result;
if (start < end) {
_result = state.input.slice(start, end);
if (checkJson) {
for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
_character = _result.charCodeAt(_position);
if (!(_character === 9 || 32 <= _character && _character <= 1114111)) {
throwError(state, "expected valid JSON character");
}
}
} else if (PATTERN_NON_PRINTABLE.test(_result)) {
throwError(state, "the stream contains non-printable characters");
}
state.result += _result;
}
}
function mergeMappings(state, destination, source, overridableKeys) {
var sourceKeys, key, index2, quantity;
if (!common.isObject(source)) {
throwError(state, "cannot merge mappings; the provided source object is unacceptable");
}
sourceKeys = Object.keys(source);
for (index2 = 0, quantity = sourceKeys.length; index2 < quantity; index2 += 1) {
key = sourceKeys[index2];
if (!_hasOwnProperty$1.call(destination, key)) {
setProperty(destination, key, source[key]);
overridableKeys[key] = true;
}
}
}
function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startLineStart, startPos) {
var index2, quantity;
if (Array.isArray(keyNode)) {
keyNode = Array.prototype.slice.call(keyNode);
for (index2 = 0, quantity = keyNode.length; index2 < quantity; index2 += 1) {
if (Array.isArray(keyNode[index2])) {
throwError(state, "nested arrays are not supported inside keys");
}
if (typeof keyNode === "object" && _class(keyNode[index2]) === "[object Object]") {
keyNode[index2] = "[object Object]";
}
}
}
if (typeof keyNode === "object" && _class(keyNode) === "[object Object]") {
keyNode = "[object Object]";
}
keyNode = String(keyNode);
if (_result === null) {
_result = {};
}
if (keyTag === "tag:yaml.org,2002:merge") {
if (Array.isArray(valueNode)) {
for (index2 = 0, quantity = valueNode.length; index2 < quantity; index2 += 1) {
mergeMappings(state, _result, valueNode[index2], overridableKeys);
}
} else {
mergeMappings(state, _result, valueNode, overridableKeys);
}
} else {
if (!state.json && !_hasOwnProperty$1.call(overridableKeys, keyNode) && _hasOwnProperty$1.call(_result, keyNode)) {
state.line = startLine || state.line;
state.lineStart = startLineStart || state.lineStart;
state.position = startPos || state.position;
throwError(state, "duplicated mapping key");
}
setProperty(_result, keyNode, valueNode);
delete overridableKeys[keyNode];
}
return _result;
}
function readLineBreak(state) {
var ch;
ch = state.input.charCodeAt(state.position);
if (ch === 10) {
state.position++;
} else if (ch === 13) {
state.position++;
if (state.input.charCodeAt(state.position) === 10) {
state.position++;
}
} else {
throwError(state, "a line break is expected");
}
state.line += 1;
state.lineStart = state.position;
state.firstTabInLine = -1;
}
function skipSeparationSpace(state, allowComments, checkIndent) {
var lineBreaks = 0, ch = state.input.charCodeAt(state.position);
while (ch !== 0) {
while (is_WHITE_SPACE(ch)) {
if (ch === 9 && state.firstTabInLine === -1) {
state.firstTabInLine = state.position;
}
ch = state.input.charCodeAt(++state.position);
}
if (allowComments && ch === 35) {
do {
ch = state.input.charCodeAt(++state.position);
} while (ch !== 10 && ch !== 13 && ch !== 0);
}
if (is_EOL(ch)) {
readLineBreak(state);
ch = state.input.charCodeAt(state.position);
lineBreaks++;
state.lineIndent = 0;
while (ch === 32) {
state.lineIndent++;
ch = state.input.charCodeAt(++state.position);
}
} else {
break;
}
}
if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
throwWarning(state, "deficient indentation");
}
return lineBreaks;
}
function testDocumentSeparator(state) {
var _position = state.position, ch;
ch = state.input.charCodeAt(_position);
if ((ch === 45 || ch === 46) && ch === state.input.charCodeAt(_position + 1) && ch === state.input.charCodeAt(_position + 2)) {
_position += 3;
ch = state.input.charCodeAt(_position);
if (ch === 0 || is_WS_OR_EOL(ch)) {
return true;
}
}
return false;
}
function writeFoldedLines(state, count) {
if (count === 1) {
state.result += " ";
} else if (count > 1) {
state.result += common.repeat("\n", count - 1);
}
}
function readPlainScalar(state, nodeIndent, withinFlowCollection) {
var preceding, following, captureStart, captureEnd, hasPendingContent, _line, _lineStart, _lineIndent, _kind = state.kind, _result = state.result, ch;
ch = state.input.charCodeAt(state.position);
if (is_WS_OR_EOL(ch) || is_FLOW_INDICATOR(ch) || ch === 35 || ch === 38 || ch === 42 || ch === 33 || ch === 124 || ch === 62 || ch === 39 || ch === 34 || ch === 37 || ch === 64 || ch === 96) {
return false;
}
if (ch === 63 || ch === 45) {
following = state.input.charCodeAt(state.position + 1);
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
return false;
}
}
state.kind = "scalar";
state.result = "";
captureStart = captureEnd = state.position;
hasPendingContent = false;
while (ch !== 0) {
if (ch === 58) {
following = state.input.charCodeAt(state.position + 1);
if (is_WS_OR_EOL(following) || withinFlowCollection && is_FLOW_INDICATOR(following)) {
break;
}
} else if (ch === 35) {
preceding = state.input.charCodeAt(state.position - 1);
if (is_WS_OR_EOL(preceding)) {
break;
}
} else if (state.position === state.lineStart && testDocumentSeparator(state) || withinFlowCollection && is_FLOW_INDICATOR(ch)) {
break;
} else if (is_EOL(ch)) {
_line = state.line;
_lineStart = state.lineStart;
_lineIndent = state.lineIndent;
skipSeparationSpace(state, false, -1);
if (state.lineIndent >= nodeIndent) {
hasPendingContent = true;
ch = state.input.charCodeAt(state.position);
continue;
} else {
state.position = captureEnd;
state.line = _line;
state.lineStart = _lineStart;
state.lineIndent = _lineIndent;
break;
}
}
if (hasPendingContent) {
captureSegment(state, captureStart, captureEnd, false);
writeFoldedLines(state, state.line - _line);
captureStart = captureEnd = state.position;
hasPendingContent = false;
}
if (!is_WHITE_SPACE(ch)) {
captureEnd = state.position + 1;
}
ch = state.input.charCodeAt(++state.position);
}
captureSegment(state, captureStart, captureEnd, false);
if (state.result) {
return true;
}
state.kind = _kind;
state.result = _result;
return false;
}
function readSingleQuotedScalar(state, nodeIndent) {
var ch, captureStart, captureEnd;
ch = state.input.charCodeAt(state.position);
if (ch !== 39) {
return false;
}
state.kind = "scalar";
state.result = "";
state.position++;
captureStart = captureEnd = state.position;
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
if (ch === 39) {
captureSegment(state, captureStart, state.position, true);
ch = state.input.charCodeAt(++state.position);
if (ch === 39) {
captureStart = state.position;
state.position++;
captureEnd = state.position;
} else {
return true;
}
} else if (is_EOL(ch)) {
captureSegment(state, captureStart, captureEnd, true);
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
captureStart = captureEnd = state.position;
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
throwError(state, "unexpected end of the document within a single quoted scalar");
} else {
state.position++;
captureEnd = state.position;
}
}
throwError(state, "unexpected end of the stream within a single quoted scalar");
}
function readDoubleQuotedScalar(state, nodeIndent) {
var captureStart, captureEnd, hexLength, hexResult, tmp, ch;
ch = state.input.charCodeAt(state.position);
if (ch !== 34) {
return false;
}
state.kind = "scalar";
state.result = "";
state.position++;
captureStart = captureEnd = state.position;
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
if (ch === 34) {
captureSegment(state, captureStart, state.position, true);
state.position++;
return true;
} else if (ch === 92) {
captureSegment(state, captureStart, state.position, true);
ch = state.input.charCodeAt(++state.position);
if (is_EOL(ch)) {
skipSeparationSpace(state, false, nodeIndent);
} else if (ch < 256 && simpleEscapeCheck[ch]) {
state.result += simpleEscapeMap[ch];
state.position++;
} else if ((tmp = escapedHexLen(ch)) > 0) {
hexLength = tmp;
hexResult = 0;
for (; hexLength > 0; hexLength--) {
ch = state.input.charCodeAt(++state.position);
if ((tmp = fromHexCode(ch)) >= 0) {
hexResult = (hexResult << 4) + tmp;
} else {
throwError(state, "expected hexadecimal character");
}
}
state.result += charFromCodepoint(hexResult);
state.position++;
} else {
throwError(state, "unknown escape sequence");
}
captureStart = captureEnd = state.position;
} else if (is_EOL(ch)) {
captureSegment(state, captureStart, captureEnd, true);
writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
captureStart = captureEnd = state.position;
} else if (state.position === state.lineStart && testDocumentSeparator(state)) {
throwError(state, "unexpected end of the document within a double quoted scalar");
} else {
state.position++;
captureEnd = state.position;
}
}
throwError(state, "unexpected end of the stream within a double quoted scalar");
}
function readFlowCollection(state, nodeIndent) {
var readNext = true, _line, _lineStart, _pos, _tag = state.tag, _result, _anchor = state.anchor, following, terminator, isPair, isExplicitPair, isMapping, overridableKeys = /* @__PURE__ */ Object.create(null), keyNode, keyTag, valueNode, ch;
ch = state.input.charCodeAt(state.position);
if (ch === 91) {
terminator = 93;
isMapping = false;
_result = [];
} else if (ch === 123) {
terminator = 125;
isMapping = true;
_result = {};
} else {
return false;
}
if (state.anchor !== null) {
state.anchorMap[state.anchor] = _result;
}
ch = state.input.charCodeAt(++state.position);
while (ch !== 0) {
skipSeparationSpace(state, true, nodeIndent);
ch = state.input.charCodeAt(state.position);
if (ch === terminator) {
state.position++;
state.tag = _tag;
state.anchor = _anchor;
state.kind = isMapping ? "mapping" : "sequence";
state.result = _result;
return true;
} else if (!readNext) {
throwError(state, "missed comma between flow collection entries");
} else if (ch === 44) {
throwError(state, "expected the node content, but found ','");
}
keyTag = keyNode = valueNode = null;
isPair = isExplicitPair = false;
if (ch === 63) {
following = state.input.charCodeAt(state.position + 1);
if (is_WS_OR_EOL(following)) {
isPair = isExplicitPair = true;
state.position++;
skipSeparationSpace(state, true, nodeIndent);
}
}
_line = state.line;
_lineStart = state.lineStart;
_pos = state.position;
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
keyTag = state.tag;
keyNode = state.result;
skipSeparationSpace(state, true, nodeIndent);
ch = state.input.charCodeAt(state.position);
if ((isExplicitPair || state.line === _line) && ch === 58) {
isPair = true;
ch = state.input.charCodeAt(++state.position);
skipSeparationSpace(state, true, nodeIndent);
composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
valueNode = state.result;
}
if (isMapping) {
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);
} else if (isPair) {
_result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));
} else {
_result.push(keyNode);
}
skipSeparationSpace(state, true, nodeIndent);
ch = state.input.charCodeAt(state.position);
if (ch === 44) {
readNext = true;
ch = state.input.charCodeAt(++state.position);
} else {
readNext = false;
}
}
throwError(state, "unexpected end of the stream within a flow collection");
}
function readBlockScalar(state, nodeIndent) {
var captureStart, folding, chomping = CHOMPING_CLIP, didReadContent = false, detectedIndent = false, textIndent = nodeIndent, emptyLines = 0, atMoreIndented = false, tmp, ch;
ch = state.input.charCodeAt(state.position);
if (ch === 124) {
folding = false;
} else if (ch === 62) {
folding = true;
} else {
return false;
}
state.kind = "scalar";
state.result = "";
while (ch !== 0) {
ch = state.input.charCodeAt(++state.position);
if (ch === 43 || ch === 45) {
if (CHOMPING_CLIP === chomping) {
chomping = ch === 43 ? CHOMPING_KEEP : CHOMPING_STRIP;
} else {
throwError(state, "repeat of a chomping mode identifier");
}
} else if ((tmp = fromDecimalCode(ch)) >= 0) {
if (tmp === 0) {
throwError(state, "bad explicit indentation width of a block scalar; it cannot be less than one");
} else if (!detectedIndent) {
textIndent = nodeIndent + tmp - 1;
detectedIndent = true;
} else {
throwError(state, "repeat of an indentation width identifier");
}
} else {
break;
}
}
if (is_WHITE_SPACE(ch)) {
do {
ch = state.input.charCodeAt(++state.position);
} while (is_WHITE_SPACE(ch));
if (ch === 35) {
do {
ch = state.input.charCodeAt(++state.position);
} while (!is_EOL(ch) && ch !== 0);
}
}
while (ch !== 0) {
readLineBreak(state);
state.lineIndent = 0;
ch = state.input.charCodeAt(state.position);
while ((!detectedIndent || state.lineIndent < textIndent) && ch === 32) {
state.lineIndent++;
ch = state.input.charCodeAt(++state.position);
}
if (!detectedIndent && state.lineIndent > textIndent) {
textIndent = state.lineIndent;
}
if (is_EOL(ch)) {
emptyLines++;
continue;
}
if (state.lineIndent < textIndent) {
if (chomping === CHOMPING_KEEP) {
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
} else if (chomping === CHOMPING_CLIP) {
if (didReadContent) {
state.result += "\n";
}
}
break;
}
if (folding) {
if (is_WHITE_SPACE(ch)) {
atMoreIndented = true;
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
} else if (atMoreIndented) {
atMoreIndented = false;
state.result += common.repeat("\n", emptyLines + 1);
} else if (emptyLines === 0) {
if (didReadContent) {
state.result += " ";
}
} else {
state.result += common.repeat("\n", emptyLines);
}
} else {
state.result += common.repeat("\n", didReadContent ? 1 + emptyLines : emptyLines);
}
didReadContent = true;
detectedIndent = true;
emptyLines = 0;
captureStart = state.position;
while (!is_EOL(ch) && ch !== 0) {
ch = state.input.charCodeAt(++state.position);
}
captureSegment(state, captureStart, state.position, false);
}
return true;
}
function readBlockSequence(state, nodeIndent) {
var _line, _tag = state.tag, _anchor = state.anchor, _result = [], following, detected = false, ch;
if (state.firstTabInLine !== -1) return false;
if (state.anchor !== null) {
state.anchorMap[state.anchor] = _result;
}
ch = state.input.charCodeAt(state.position);
while (ch !== 0) {
if (state.firstTabInLine !== -1) {
state.position = state.firstTabInLine;
throwError(state, "tab characters must not be used in indentation");
}
if (ch !== 45) {
break;
}
following = state.input.charCodeAt(state.position + 1);
if (!is_WS_OR_EOL(following)) {
break;
}
detected = true;
state.position++;
if (skipSeparationSpace(state, true, -1)) {
if (state.lineIndent <= nodeIndent) {
_result.push(null);
ch = state.input.charCodeAt(state.position);
continue;
}
}
_line = state.line;
composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
_result.push(state.result);
skipSeparationSpace(state, true, -1);
ch = state.input.charCodeAt(state.position);
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
throwError(state, "bad indentation of a sequence entry");
} else if (state.lineIndent < nodeIndent) {
break;
}
}
if (detected) {
state.tag = _tag;
state.anchor = _anchor;
state.kind = "sequence";
state.result = _result;
return true;
}
return false;
}
function readBlockMapping(state, nodeIndent, flowIndent) {
var following, allowCompact, _line, _keyLine, _keyLineStart, _keyPos, _tag = state.tag, _anchor = state.anchor, _result = {}, overridableKeys = /* @__PURE__ */ Object.create(null), keyTag = null, keyNode = null, valueNode = null, atExplicitKey = false, detected = false, ch;
if (state.firstTabInLine !== -1) return false;
if (state.anchor !== null) {
state.anchorMap[state.anchor] = _result;
}
ch = state.input.charCodeAt(state.position);
while (ch !== 0) {
if (!atExplicitKey && state.firstTabInLine !== -1) {
state.position = state.firstTabInLine;
throwError(state, "tab characters must not be used in indentation");
}
following = state.input.charCodeAt(state.position + 1);
_line = state.line;
if ((ch === 63 || ch === 58) && is_WS_OR_EOL(following)) {
if (ch === 63) {
if (atExplicitKey) {
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
keyTag = keyNode = valueNode = null;
}
detected = true;
atExplicitKey = true;
allowCompact = true;
} else if (atExplicitKey) {
atExplicitKey = false;
allowCompact = true;
} else {
throwError(state, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");
}
state.position += 1;
ch = following;
} else {
_keyLine = state.line;
_keyLineStart = state.lineStart;
_keyPos = state.position;
if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
break;
}
if (state.line === _line) {
ch = state.input.charCodeAt(state.position);
while (is_WHITE_SPACE(ch)) {
ch = state.input.charCodeAt(++state.position);
}
if (ch === 58) {
ch = state.input.charCodeAt(++state.position);
if (!is_WS_OR_EOL(ch)) {
throwError(state, "a whitespace character is expected after the key-value separator within a block mapping");
}
if (atExplicitKey) {
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
keyTag = keyNode = valueNode = null;
}
detected = true;
atExplicitKey = false;
allowCompact = false;
keyTag = state.tag;
keyNode = state.result;
} else if (detected) {
throwError(state, "can not read an implicit mapping pair; a colon is missed");
} else {
state.tag = _tag;
state.anchor = _anchor;
return true;
}
} else if (detected) {
throwError(state, "can not read a block mapping entry; a multiline key may not be an implicit key");
} else {
state.tag = _tag;
state.anchor = _anchor;
return true;
}
}
if (state.line === _line || state.lineIndent > nodeIndent) {
if (atExplicitKey) {
_keyLine = state.line;
_keyLineStart = state.lineStart;
_keyPos = state.position;
}
if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
if (atExplicitKey) {
keyNode = state.result;
} else {
valueNode = state.result;
}
}
if (!atExplicitKey) {
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);
keyTag = keyNode = valueNode = null;
}
skipSeparationSpace(state, true, -1);
ch = state.input.charCodeAt(state.position);
}
if ((state.line === _line || state.lineIndent > nodeIndent) && ch !== 0) {
throwError(state, "bad indentation of a mapping entry");
} else if (state.lineIndent < nodeIndent) {
break;
}
}
if (atExplicitKey) {
storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);
}
if (detected) {
state.tag = _tag;
state.anchor = _anchor;
state.kind = "mapping";
state.result = _result;
}
return detected;
}
function readTagProperty(state) {
var _position, isVerbatim = false, isNamed = false, tagHandle, tagName, ch;
ch = state.input.charCodeAt(state.position);
if (ch !== 33) return false;
if (state.tag !== null) {
throwError(state, "duplication of a tag property");
}
ch = state.input.charCodeAt(++state.position);
if (ch === 60) {
isVerbatim = true;
ch = state.input.charCodeAt(++state.position);
} else if (ch === 33) {
isNamed = true;
tagHandle = "!!";
ch = state.input.charCodeAt(++state.position);
} else {
tagHandle = "!";
}
_position = state.position;
if (isVerbatim) {
do {
ch = state.input.charCodeAt(++state.position);
} while (ch !== 0 && ch !== 62);
if (state.position < state.length) {
tagName = state.input.slice(_position, state.position);
ch = state.input.charCodeAt(++state.position);
} else {
throwError(state, "unexpected end of the stream within a verbatim tag");
}
} else {
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
if (ch === 33) {
if (!isNamed) {
tagHandle = state.input.slice(_position - 1, state.position + 1);
if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
throwError(state, "named tag handle cannot contain such characters");
}
isNamed = true;
_position = state.position + 1;
} else {
throwError(state, "tag suffix cannot contain exclamation marks");
}
}
ch = state.input.charCodeAt(++state.position);
}
tagName = state.input.slice(_position, state.position);
if (PATTERN_FLOW_INDICATORS.test(tagName)) {
throwError(state, "tag suffix cannot contain flow indicator characters");
}
}
if (tagName && !PATTERN_TAG_URI.test(tagName)) {
throwError(state, "tag name cannot contain such characters: " + tagName);
}
try {
tagName = decodeURIComponent(tagName);
} catch (err) {
throwError(state, "tag name is malformed: " + tagName);
}
if (isVerbatim) {
state.tag = tagName;
} else if (_hasOwnProperty$1.call(state.tagMap, tagHandle)) {
state.tag = state.tagMap[tagHandle] + tagName;
} else if (tagHandle === "!") {
state.tag = "!" + tagName;
} else if (tagHandle === "!!") {
state.tag = "tag:yaml.org,2002:" + tagName;
} else {
throwError(state, 'undeclared tag handle "' + tagHandle + '"');
}
return true;
}
function readAnchorProperty(state) {
var _position, ch;
ch = state.input.charCodeAt(state.position);
if (ch !== 38) return false;
if (state.anchor !== null) {
throwError(state, "duplication of an anchor property");
}
ch = state.input.charCodeAt(++state.position);
_position = state.position;
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
ch = state.input.charCodeAt(++state.position);
}
if (state.position === _position) {
throwError(state, "name of an anchor node must contain at least one character");
}
state.anchor = state.input.slice(_position, state.position);
return true;
}
function readAlias(state) {
var _position, alias, ch;
ch = state.input.charCodeAt(state.position);
if (ch !== 42) return false;
ch = state.input.charCodeAt(++state.position);
_position = state.position;
while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
ch = state.input.charCodeAt(++state.position);
}
if (state.position === _position) {
throwError(state, "name of an alias node must contain at least one character");
}
alias = state.input.slice(_position, state.position);
if (!_hasOwnProperty$1.call(state.anchorMap, alias)) {
throwError(state, 'unidentified alias "' + alias + '"');
}
state.result = state.anchorMap[alias];
skipSeparationSpace(state, true, -1);
return true;
}
function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
var allowBlockStyles, allowBlockScalars, allowBlockCollections, indentStatus = 1, atNewLine = false, hasContent = false, typeIndex, typeQuantity, typeList, type2, flowIndent, blockIndent;
if (state.listener !== null) {
state.listener("open", state);
}
state.tag = null;
state.anchor = null;
state.kind = null;
state.result = null;
allowBlockStyles = allowBlockScalars = allowBlockCollections = CONTEXT_BLOCK_OUT === nodeContext || CONTEXT_BLOCK_IN === nodeContext;
if (allowToSeek) {
if (skipSeparationSpace(state, true, -1)) {
atNewLine = true;
if (state.lineIndent > parentIndent) {
indentStatus = 1;
} else if (state.lineIndent === parentIndent) {
indentStatus = 0;
} else if (state.lineIndent < parentIndent) {
indentStatus = -1;
}
}
}
if (indentStatus === 1) {
while (readTagProperty(state) || readAnchorProperty(state)) {
if (skipSeparationSpace(state, true, -1)) {
atNewLine = true;
allowBlockCollections = allowBlockStyles;
if (state.lineIndent > parentIndent) {
indentStatus = 1;
} else if (state.lineIndent === parentIndent) {
indentStatus = 0;
} else if (state.lineIndent < parentIndent) {
indentStatus = -1;
}
} else {
allowBlockCollections = false;
}
}
}
if (allowBlockCollections) {
allowBlockCollections = atNewLine || allowCompact;
}
if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
flowIndent = parentIndent;
} else {
flowIndent = parentIndent + 1;
}
blockIndent = state.position - state.lineStart;
if (indentStatus === 1) {
if (allowBlockCollections && (readBlockSequence(state, blockIndent) || readBlockMapping(state, blockIndent, flowIndent)) || readFlowCollection(state, flowIndent)) {
hasContent = true;
} else {
if (allowBlockScalars && readBlockScalar(state, flowIndent) || readSingleQuotedScalar(state, flowIndent) || readDoubleQuotedScalar(state, flowIndent)) {
hasContent = true;
} else if (readAlias(state)) {
hasContent = true;
if (state.tag !== null || state.anchor !== null) {
throwError(state, "alias node should not have any properties");
}
} else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
hasContent = true;
if (state.tag === null) {
state.tag = "?";
}
}
if (state.anchor !== null) {
state.anchorMap[state.anchor] = state.result;
}
}
} else if (indentStatus === 0) {
hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
}
}
if (state.tag === null) {
if (state.anchor !== null) {
state.anchorMap[state.anchor] = state.result;
}
} else if (state.tag === "?") {
if (state.result !== null && state.kind !== "scalar") {
throwError(state, 'unacceptable node kind for !> tag; it should be "scalar", not "' + state.kind + '"');
}
for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
type2 = state.implicitTypes[typeIndex];
if (type2.resolve(state.result)) {
state.result = type2.construct(state.result);
state.tag = type2.tag;
if (state.anchor !== null) {
state.anchorMap[state.anchor] = state.result;
}
break;
}
}
} else if (state.tag !== "!") {
if (_hasOwnProperty$1.call(state.typeMap[state.kind || "fallback"], state.tag)) {
type2 = state.typeMap[state.kind || "fallback"][state.tag];
} else {
type2 = null;
typeList = state.typeMap.multi[state.kind || "fallback"];
for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {
if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {
type2 = typeList[typeIndex];
break;
}
}
}
if (!type2) {
throwError(state, "unknown tag !<" + state.tag + ">");
}
if (state.result !== null && type2.kind !== state.kind) {
throwError(state, "unacceptable node kind for !<" + state.tag + '> tag; it should be "' + type2.kind + '", not "' + state.kind + '"');
}
if (!type2.resolve(state.result, state.tag)) {
throwError(state, "cannot resolve a node with !<" + state.tag + "> explicit tag");
} else {
state.result = type2.construct(state.result, state.tag);
if (state.anchor !== null) {
state.anchorMap[state.anchor] = state.result;
}
}
}
if (state.listener !== null) {
state.listener("close", state);
}
return state.tag !== null || state.anchor !== null || hasContent;
}
function readDocument(state) {
var documentStart = state.position, _position, directiveName, directiveArgs, hasDirectives = false, ch;
state.version = null;
state.checkLineBreaks = state.legacy;
state.tagMap = /* @__PURE__ */ Object.create(null);
state.anchorMap = /* @__PURE__ */ Object.create(null);
while ((ch = state.input.charCodeAt(state.position)) !== 0) {
skipSeparationSpace(state, true, -1);
ch = state.input.charCodeAt(state.position);
if (state.lineIndent > 0 || ch !== 37) {
break;
}
hasDirectives = true;
ch = state.input.charCodeAt(++state.position);
_position = state.position;
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
ch = state.input.charCodeAt(++state.position);
}
directiveName = state.input.slice(_position, state.position);
directiveArgs = [];
if (directiveName.length < 1) {
throwError(state, "directive name must not be less than one character in length");
}
while (ch !== 0) {
while (is_WHITE_SPACE(ch)) {
ch = state.input.charCodeAt(++state.position);
}
if (ch === 35) {
do {
ch = state.input.charCodeAt(++state.position);
} while (ch !== 0 && !is_EOL(ch));
break;
}
if (is_EOL(ch)) break;
_position = state.position;
while (ch !== 0 && !is_WS_OR_EOL(ch)) {
ch = state.input.charCodeAt(++state.position);
}
directiveArgs.push(state.input.slice(_position, state.position));
}
if (ch !== 0) readLineBreak(state);
if (_hasOwnProperty$1.call(directiveHandlers, directiveName)) {
directiveHandlers[directiveName](state, directiveName, directiveArgs);
} else {
throwWarning(state, 'unknown document directive "' + directiveName + '"');
}
}
skipSeparationSpace(state, true, -1);
if (state.lineIndent === 0 && state.input.charCodeAt(state.position) === 45 && state.input.charCodeAt(state.position + 1) === 45 && state.input.charCodeAt(state.position + 2) === 45) {
state.position += 3;
skipSeparationSpace(state, true, -1);
} else if (hasDirectives) {
throwError(state, "directives end mark is expected");
}
composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
skipSeparationSpace(state, true, -1);
if (state.checkLineBreaks && PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
throwWarning(state, "non-ASCII line breaks are interpreted as content");
}
state.documents.push(state.result);
if (state.position === state.lineStart && testDocumentSeparator(state)) {
if (state.input.charCodeAt(state.position) === 46) {
state.position += 3;
skipSeparationSpace(state, true, -1);
}
return;
}
if (state.position < state.length - 1) {
throwError(state, "end of the stream or a document separator is expected");
} else {
return;
}
}
function loadDocuments(input, options) {
input = String(input);
options = options || {};
if (input.length !== 0) {
if (input.charCodeAt(input.length - 1) !== 10 && input.charCodeAt(input.length - 1) !== 13) {
input += "\n";
}
if (input.charCodeAt(0) === 65279) {
input = input.slice(1);
}
}
var state = new State$1(input, options);
var nullpos = input.indexOf("\0");
if (nullpos !== -1) {
state.position = nullpos;
throwError(state, "null byte is not allowed in input");
}
state.input += "\0";
while (state.input.charCodeAt(state.position) === 32) {
state.lineIndent += 1;
state.position += 1;
}
while (state.position < state.length - 1) {
readDocument(state);
}
return state.documents;
}
function loadAll$1(input, iterator, options) {
if (iterator !== null && typeof iterator === "object" && typeof options === "undefined") {
options = iterator;
iterator = null;
}
var documents = loadDocuments(input, options);
if (typeof iterator !== "function") {
return documents;
}
for (var index2 = 0, length = documents.length; index2 < length; index2 += 1) {
iterator(documents[index2]);
}
}
function load$1(input, options) {
var documents = loadDocuments(input, options);
if (documents.length === 0) {
return void 0;
} else if (documents.length === 1) {
return documents[0];
}
throw new exception("expected a single document in the stream, but found more");
}
var loadAll_1 = loadAll$1;
var load_1 = load$1;
var loader = {
loadAll: loadAll_1,
load: load_1
};
var _toString = Object.prototype.toString;
var _hasOwnProperty = Object.prototype.hasOwnProperty;
var CHAR_BOM = 65279;
var CHAR_TAB = 9;
var CHAR_LINE_FEED = 10;
var CHAR_CARRIAGE_RETURN = 13;
var CHAR_SPACE = 32;
var CHAR_EXCLAMATION = 33;
var CHAR_DOUBLE_QUOTE = 34;
var CHAR_SHARP = 35;
var CHAR_PERCENT = 37;
var CHAR_AMPERSAND = 38;
var CHAR_SINGLE_QUOTE = 39;
var CHAR_ASTERISK = 42;
var CHAR_COMMA = 44;
var CHAR_MINUS = 45;
var CHAR_COLON = 58;
var CHAR_EQUALS = 61;
var CHAR_GREATER_THAN = 62;
var CHAR_QUESTION = 63;
var CHAR_COMMERCIAL_AT = 64;
var CHAR_LEFT_SQUARE_BRACKET = 91;
var CHAR_RIGHT_SQUARE_BRACKET = 93;
var CHAR_GRAVE_ACCENT = 96;
var CHAR_LEFT_CURLY_BRACKET = 123;
var CHAR_VERTICAL_LINE = 124;
var CHAR_RIGHT_CURLY_BRACKET = 125;
var ESCAPE_SEQUENCES = {};
ESCAPE_SEQUENCES[0] = "\\0";
ESCAPE_SEQUENCES[7] = "\\a";
ESCAPE_SEQUENCES[8] = "\\b";
ESCAPE_SEQUENCES[9] = "\\t";
ESCAPE_SEQUENCES[10] = "\\n";
ESCAPE_SEQUENCES[11] = "\\v";
ESCAPE_SEQUENCES[12] = "\\f";
ESCAPE_SEQUENCES[13] = "\\r";
ESCAPE_SEQUENCES[27] = "\\e";
ESCAPE_SEQUENCES[34] = '\\"';
ESCAPE_SEQUENCES[92] = "\\\\";
ESCAPE_SEQUENCES[133] = "\\N";
ESCAPE_SEQUENCES[160] = "\\_";
ESCAPE_SEQUENCES[8232] = "\\L";
ESCAPE_SEQUENCES[8233] = "\\P";
var DEPRECATED_BOOLEANS_SYNTAX = [
"y",
"Y",
"yes",
"Yes",
"YES",
"on",
"On",
"ON",
"n",
"N",
"no",
"No",
"NO",
"off",
"Off",
"OFF"
];
var DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;
function compileStyleMap(schema2, map2) {
var result, keys, index2, length, tag, style, type2;
if (map2 === null) return {};
result = {};
keys = Object.keys(map2);
for (index2 = 0, length = keys.length; index2 < length; index2 += 1) {
tag = keys[index2];
style = String(map2[tag]);
if (tag.slice(0, 2) === "!!") {
tag = "tag:yaml.org,2002:" + tag.slice(2);
}
type2 = schema2.compiledTypeMap["fallback"][tag];
if (type2 && _hasOwnProperty.call(type2.styleAliases, style)) {
style = type2.styleAliases[style];
}
result[tag] = style;
}
return result;
}
function encodeHex(character) {
var string, handle, length;
string = character.toString(16).toUpperCase();
if (character <= 255) {
handle = "x";
length = 2;
} else if (character <= 65535) {
handle = "u";
length = 4;
} else if (character <= 4294967295) {
handle = "U";
length = 8;
} else {
throw new exception("code point within a string may not be greater than 0xFFFFFFFF");
}
return "\\" + handle + common.repeat("0", length - string.length) + string;
}
var QUOTING_TYPE_SINGLE = 1;
var QUOTING_TYPE_DOUBLE = 2;
function State(options) {
this.schema = options["schema"] || _default;
this.indent = Math.max(1, options["indent"] || 2);
this.noArrayIndent = options["noArrayIndent"] || false;
this.skipInvalid = options["skipInvalid"] || false;
this.flowLevel = common.isNothing(options["flowLevel"]) ? -1 : options["flowLevel"];
this.styleMap = compileStyleMap(this.schema, options["styles"] || null);
this.sortKeys = options["sortKeys"] || false;
this.lineWidth = options["lineWidth"] || 80;
this.noRefs = options["noRefs"] || false;
this.noCompatMode = options["noCompatMode"] || false;
this.condenseFlow = options["condenseFlow"] || false;
this.quotingType = options["quotingType"] === '"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;
this.forceQuotes = options["forceQuotes"] || false;
this.replacer = typeof options["replacer"] === "function" ? options["replacer"] : null;
this.implicitTypes = this.schema.compiledImplicit;
this.explicitTypes = this.schema.compiledExplicit;
this.tag = null;
this.result = "";
this.duplicates = [];
this.usedDuplicates = null;
}
function indentString(string, spaces) {
var ind = common.repeat(" ", spaces), position = 0, next = -1, result = "", line, length = string.length;
while (position < length) {
next = string.indexOf("\n", position);
if (next === -1) {
line = string.slice(position);
position = length;
} else {
line = string.slice(position, next + 1);
position = next + 1;
}
if (line.length && line !== "\n") result += ind;
result += line;
}
return result;
}
function generateNextLine(state, level) {
return "\n" + common.repeat(" ", state.indent * level);
}
function testImplicitResolving(state, str2) {
var index2, length, type2;
for (index2 = 0, length = state.implicitTypes.length; index2 < length; index2 += 1) {
type2 = state.implicitTypes[index2];
if (type2.resolve(str2)) {
return true;
}
}
return false;
}
function isWhitespace(c) {
return c === CHAR_SPACE || c === CHAR_TAB;
}
function isPrintable(c) {
return 32 <= c && c <= 126 || 161 <= c && c <= 55295 && c !== 8232 && c !== 8233 || 57344 <= c && c <= 65533 && c !== CHAR_BOM || 65536 <= c && c <= 1114111;
}
function isNsCharOrWhitespace(c) {
return isPrintable(c) && c !== CHAR_BOM && c !== CHAR_CARRIAGE_RETURN && c !== CHAR_LINE_FEED;
}
function isPlainSafe(c, prev, inblock) {
var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);
var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);
return (
// ns-plain-safe
(inblock ? (
// c = flow-in
cIsNsCharOrWhitespace
) : cIsNsCharOrWhitespace && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET) && c !== CHAR_SHARP && !(prev === CHAR_COLON && !cIsNsChar) || isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP || prev === CHAR_COLON && cIsNsChar
);
}
function isPlainSafeFirst(c) {
return isPrintable(c) && c !== CHAR_BOM && !isWhitespace(c) && c !== CHAR_MINUS && c !== CHAR_QUESTION && c !== CHAR_COLON && c !== CHAR_COMMA && c !== CHAR_LEFT_SQUARE_BRACKET && c !== CHAR_RIGHT_SQUARE_BRACKET && c !== CHAR_LEFT_CURLY_BRACKET && c !== CHAR_RIGHT_CURLY_BRACKET && c !== CHAR_SHARP && c !== CHAR_AMPERSAND && c !== CHAR_ASTERISK && c !== CHAR_EXCLAMATION && c !== CHAR_VERTICAL_LINE && c !== CHAR_EQUALS && c !== CHAR_GREATER_THAN && c !== CHAR_SINGLE_QUOTE && c !== CHAR_DOUBLE_QUOTE && c !== CHAR_PERCENT && c !== CHAR_COMMERCIAL_AT && c !== CHAR_GRAVE_ACCENT;
}
function isPlainSafeLast(c) {
return !isWhitespace(c) && c !== CHAR_COLON;
}
function codePointAt(string, pos) {
var first = string.charCodeAt(pos), second;
if (first >= 55296 && first <= 56319 && pos + 1 < string.length) {
second = string.charCodeAt(pos + 1);
if (second >= 56320 && second <= 57343) {
return (first - 55296) * 1024 + second - 56320 + 65536;
}
}
return first;
}
function needIndentIndicator(string) {
var leadingSpaceRe = /^\n* /;
return leadingSpaceRe.test(string);
}
var STYLE_PLAIN = 1;
var STYLE_SINGLE = 2;
var STYLE_LITERAL = 3;
var STYLE_FOLDED = 4;
var STYLE_DOUBLE = 5;
function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType, quotingType, forceQuotes, inblock) {
var i;
var char = 0;
var prevChar = null;
var hasLineBreak = false;
var hasFoldableLine = false;
var shouldTrackWidth = lineWidth !== -1;
var previousLineBreak = -1;
var plain = isPlainSafeFirst(codePointAt(string, 0)) && isPlainSafeLast(codePointAt(string, string.length - 1));
if (singleLineOnly || forceQuotes) {
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
char = codePointAt(string, i);
if (!isPrintable(char)) {
return STYLE_DOUBLE;
}
plain = plain && isPlainSafe(char, prevChar, inblock);
prevChar = char;
}
} else {
for (i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
char = codePointAt(string, i);
if (char === CHAR_LINE_FEED) {
hasLineBreak = true;
if (shouldTrackWidth) {
hasFoldableLine = hasFoldableLine || // Foldable line = too long, and not more-indented.
i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ";
previousLineBreak = i;
}
} else if (!isPrintable(char)) {
return STYLE_DOUBLE;
}
plain = plain && isPlainSafe(char, prevChar, inblock);
prevChar = char;
}
hasFoldableLine = hasFoldableLine || shouldTrackWidth && (i - previousLineBreak - 1 > lineWidth && string[previousLineBreak + 1] !== " ");
}
if (!hasLineBreak && !hasFoldableLine) {
if (plain && !forceQuotes && !testAmbiguousType(string)) {
return STYLE_PLAIN;
}
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
}
if (indentPerLevel > 9 && needIndentIndicator(string)) {
return STYLE_DOUBLE;
}
if (!forceQuotes) {
return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
}
return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;
}
function writeScalar(state, string, level, iskey, inblock) {
state.dump = function() {
if (string.length === 0) {
return state.quotingType === QUOTING_TYPE_DOUBLE ? '""' : "''";
}
if (!state.noCompatMode) {
if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {
return state.quotingType === QUOTING_TYPE_DOUBLE ? '"' + string + '"' : "'" + string + "'";
}
}
var indent = state.indent * Math.max(1, level);
var lineWidth = state.lineWidth === -1 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
var singleLineOnly = iskey || state.flowLevel > -1 && level >= state.flowLevel;
function testAmbiguity(string2) {
return testImplicitResolving(state, string2);
}
switch (chooseScalarStyle(
string,
singleLineOnly,
state.indent,
lineWidth,
testAmbiguity,
state.quotingType,
state.forceQuotes && !iskey,
inblock
)) {
case STYLE_PLAIN:
return string;
case STYLE_SINGLE:
return "'" + string.replace(/'/g, "''") + "'";
case STYLE_LITERAL:
return "|" + blockHeader(string, state.indent) + dropEndingNewline(indentString(string, indent));
case STYLE_FOLDED:
return ">" + blockHeader(string, state.indent) + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
case STYLE_DOUBLE:
return '"' + escapeString(string) + '"';
default:
throw new exception("impossible error: invalid scalar style");
}
}();
}
function blockHeader(string, indentPerLevel) {
var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : "";
var clip = string[string.length - 1] === "\n";
var keep = clip && (string[string.length - 2] === "\n" || string === "\n");
var chomp = keep ? "+" : clip ? "" : "-";
return indentIndicator + chomp + "\n";
}
function dropEndingNewline(string) {
return string[string.length - 1] === "\n" ? string.slice(0, -1) : string;
}
function foldString(string, width) {
var lineRe = /(\n+)([^\n]*)/g;
var result = function() {
var nextLF = string.indexOf("\n");
nextLF = nextLF !== -1 ? nextLF : string.length;
lineRe.lastIndex = nextLF;
return foldLine(string.slice(0, nextLF), width);
}();
var prevMoreIndented = string[0] === "\n" || string[0] === " ";
var moreIndented;
var match;
while (match = lineRe.exec(string)) {
var prefix = match[1], line = match[2];
moreIndented = line[0] === " ";
result += prefix + (!prevMoreIndented && !moreIndented && line !== "" ? "\n" : "") + foldLine(line, width);
prevMoreIndented = moreIndented;
}
return result;
}
function foldLine(line, width) {
if (line === "" || line[0] === " ") return line;
var breakRe = / [^ ]/g;
var match;
var start = 0, end, curr = 0, next = 0;
var result = "";
while (match = breakRe.exec(line)) {
next = match.index;
if (next - start > width) {
end = curr > start ? curr : next;
result += "\n" + line.slice(start, end);
start = end + 1;
}
curr = next;
}
result += "\n";
if (line.length - start > width && curr > start) {
result += line.slice(start, curr) + "\n" + line.slice(curr + 1);
} else {
result += line.slice(start);
}
return result.slice(1);
}
function escapeString(string) {
var result = "";
var char = 0;
var escapeSeq;
for (var i = 0; i < string.length; char >= 65536 ? i += 2 : i++) {
char = codePointAt(string, i);
escapeSeq = ESCAPE_SEQUENCES[char];
if (!escapeSeq && isPrintable(char)) {
result += string[i];
if (char >= 65536) result += string[i + 1];
} else {
result += escapeSeq || encodeHex(char);
}
}
return result;
}
function writeFlowSequence(state, level, object) {
var _result = "", _tag = state.tag, index2, length, value;
for (index2 = 0, length = object.length; index2 < length; index2 += 1) {
value = object[index2];
if (state.replacer) {
value = state.replacer.call(object, String(index2), value);
}
if (writeNode(state, level, value, false, false) || typeof value === "undefined" && writeNode(state, level, null, false, false)) {
if (_result !== "") _result += "," + (!state.condenseFlow ? " " : "");
_result += state.dump;
}
}
state.tag = _tag;
state.dump = "[" + _result + "]";
}
function writeBlockSequence(state, level, object, compact) {
var _result = "", _tag = state.tag, index2, length, value;
for (index2 = 0, length = object.length; index2 < length; index2 += 1) {
value = object[index2];
if (state.replacer) {
value = state.replacer.call(object, String(index2), value);
}
if (writeNode(state, level + 1, value, true, true, false, true) || typeof value === "undefined" && writeNode(state, level + 1, null, true, true, false, true)) {
if (!compact || _result !== "") {
_result += generateNextLine(state, level);
}
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
_result += "-";
} else {
_result += "- ";
}
_result += state.dump;
}
}
state.tag = _tag;
state.dump = _result || "[]";
}
function writeFlowMapping(state, level, object) {
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index2, length, objectKey, objectValue, pairBuffer;
for (index2 = 0, length = objectKeyList.length; index2 < length; index2 += 1) {
pairBuffer = "";
if (_result !== "") pairBuffer += ", ";
if (state.condenseFlow) pairBuffer += '"';
objectKey = objectKeyList[index2];
objectValue = object[objectKey];
if (state.replacer) {
objectValue = state.replacer.call(object, objectKey, objectValue);
}
if (!writeNode(state, level, objectKey, false, false)) {
continue;
}
if (state.dump.length > 1024) pairBuffer += "? ";
pairBuffer += state.dump + (state.condenseFlow ? '"' : "") + ":" + (state.condenseFlow ? "" : " ");
if (!writeNode(state, level, objectValue, false, false)) {
continue;
}
pairBuffer += state.dump;
_result += pairBuffer;
}
state.tag = _tag;
state.dump = "{" + _result + "}";
}
function writeBlockMapping(state, level, object, compact) {
var _result = "", _tag = state.tag, objectKeyList = Object.keys(object), index2, length, objectKey, objectValue, explicitPair, pairBuffer;
if (state.sortKeys === true) {
objectKeyList.sort();
} else if (typeof state.sortKeys === "function") {
objectKeyList.sort(state.sortKeys);
} else if (state.sortKeys) {
throw new exception("sortKeys must be a boolean or a function");
}
for (index2 = 0, length = objectKeyList.length; index2 < length; index2 += 1) {
pairBuffer = "";
if (!compact || _result !== "") {
pairBuffer += generateNextLine(state, level);
}
objectKey = objectKeyList[index2];
objectValue = object[objectKey];
if (state.replacer) {
objectValue = state.replacer.call(object, objectKey, objectValue);
}
if (!writeNode(state, level + 1, objectKey, true, true, true)) {
continue;
}
explicitPair = state.tag !== null && state.tag !== "?" || state.dump && state.dump.length > 1024;
if (explicitPair) {
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
pairBuffer += "?";
} else {
pairBuffer += "? ";
}
}
pairBuffer += state.dump;
if (explicitPair) {
pairBuffer += generateNextLine(state, level);
}
if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
continue;
}
if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
pairBuffer += ":";
} else {
pairBuffer += ": ";
}
pairBuffer += state.dump;
_result += pairBuffer;
}
state.tag = _tag;
state.dump = _result || "{}";
}
function detectType(state, object, explicit) {
var _result, typeList, index2, length, type2, style;
typeList = explicit ? state.explicitTypes : state.implicitTypes;
for (index2 = 0, length = typeList.length; index2 < length; index2 += 1) {
type2 = typeList[index2];
if ((type2.instanceOf || type2.predicate) && (!type2.instanceOf || typeof object === "object" && object instanceof type2.instanceOf) && (!type2.predicate || type2.predicate(object))) {
if (explicit) {
if (type2.multi && type2.representName) {
state.tag = type2.representName(object);
} else {
state.tag = type2.tag;
}
} else {
state.tag = "?";
}
if (type2.represent) {
style = state.styleMap[type2.tag] || type2.defaultStyle;
if (_toString.call(type2.represent) === "[object Function]") {
_result = type2.represent(object, style);
} else if (_hasOwnProperty.call(type2.represent, style)) {
_result = type2.represent[style](object, style);
} else {
throw new exception("!<" + type2.tag + '> tag resolver accepts not "' + style + '" style');
}
state.dump = _result;
}
return true;
}
}
return false;
}
function writeNode(state, level, object, block, compact, iskey, isblockseq) {
state.tag = null;
state.dump = object;
if (!detectType(state, object, false)) {
detectType(state, object, true);
}
var type2 = _toString.call(state.dump);
var inblock = block;
var tagStr;
if (block) {
block = state.flowLevel < 0 || state.flowLevel > level;
}
var objectOrArray = type2 === "[object Object]" || type2 === "[object Array]", duplicateIndex, duplicate;
if (objectOrArray) {
duplicateIndex = state.duplicates.indexOf(object);
duplicate = duplicateIndex !== -1;
}
if (state.tag !== null && state.tag !== "?" || duplicate || state.indent !== 2 && level > 0) {
compact = false;
}
if (duplicate && state.usedDuplicates[duplicateIndex]) {
state.dump = "*ref_" + duplicateIndex;
} else {
if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
state.usedDuplicates[duplicateIndex] = true;
}
if (type2 === "[object Object]") {
if (block && Object.keys(state.dump).length !== 0) {
writeBlockMapping(state, level, state.dump, compact);
if (duplicate) {
state.dump = "&ref_" + duplicateIndex + state.dump;
}
} else {
writeFlowMapping(state, level, state.dump);
if (duplicate) {
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
}
}
} else if (type2 === "[object Array]") {
if (block && state.dump.length !== 0) {
if (state.noArrayIndent && !isblockseq && level > 0) {
writeBlockSequence(state, level - 1, state.dump, compact);
} else {
writeBlockSequence(state, level, state.dump, compact);
}
if (duplicate) {
state.dump = "&ref_" + duplicateIndex + state.dump;
}
} else {
writeFlowSequence(state, level, state.dump);
if (duplicate) {
state.dump = "&ref_" + duplicateIndex + " " + state.dump;
}
}
} else if (type2 === "[object String]") {
if (state.tag !== "?") {
writeScalar(state, state.dump, level, iskey, inblock);
}
} else if (type2 === "[object Undefined]") {
return false;
} else {
if (state.skipInvalid) return false;
throw new exception("unacceptable kind of an object to dump " + type2);
}
if (state.tag !== null && state.tag !== "?") {
tagStr = encodeURI(
state.tag[0] === "!" ? state.tag.slice(1) : state.tag
).replace(/!/g, "%21");
if (state.tag[0] === "!") {
tagStr = "!" + tagStr;
} else if (tagStr.slice(0, 18) === "tag:yaml.org,2002:") {
tagStr = "!!" + tagStr.slice(18);
} else {
tagStr = "!<" + tagStr + ">";
}
state.dump = tagStr + " " + state.dump;
}
}
return true;
}
function getDuplicateReferences(object, state) {
var objects = [], duplicatesIndexes = [], index2, length;
inspectNode(object, objects, duplicatesIndexes);
for (index2 = 0, length = duplicatesIndexes.length; index2 < length; index2 += 1) {
state.duplicates.push(objects[duplicatesIndexes[index2]]);
}
state.usedDuplicates = new Array(length);
}
function inspectNode(object, objects, duplicatesIndexes) {
var objectKeyList, index2, length;
if (object !== null && typeof object === "object") {
index2 = objects.indexOf(object);
if (index2 !== -1) {
if (duplicatesIndexes.indexOf(index2) === -1) {
duplicatesIndexes.push(index2);
}
} else {
objects.push(object);
if (Array.isArray(object)) {
for (index2 = 0, length = object.length; index2 < length; index2 += 1) {
inspectNode(object[index2], objects, duplicatesIndexes);
}
} else {
objectKeyList = Object.keys(object);
for (index2 = 0, length = objectKeyList.length; index2 < length; index2 += 1) {
inspectNode(object[objectKeyList[index2]], objects, duplicatesIndexes);
}
}
}
}
}
function dump$1(input, options) {
options = options || {};
var state = new State(options);
if (!state.noRefs) getDuplicateReferences(input, state);
var value = input;
if (state.replacer) {
value = state.replacer.call({ "": value }, "", value);
}
if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
return "";
}
var dump_1 = dump$1;
var dumper = {
dump: dump_1
};
function renamed(from, to) {
return function() {
throw new Error("Function yaml." + from + " is removed in js-yaml 4. Use yaml." + to + " instead, which is now safe by default.");
};
}
var Type = type;
var Schema = schema;
var FAILSAFE_SCHEMA = failsafe;
var JSON_SCHEMA = json;
var CORE_SCHEMA = core;
var DEFAULT_SCHEMA = _default;
var load = loader.load;
var loadAll = loader.loadAll;
var dump = dumper.dump;
var YAMLException = exception;
var types = {
binary,
float,
map,
null: _null,
pairs,
set,
timestamp,
bool,
int,
merge,
omap,
seq,
str
};
var safeLoad = renamed("safeLoad", "load");
var safeLoadAll = renamed("safeLoadAll", "loadAll");
var safeDump = renamed("safeDump", "dump");
var jsYaml = {
Type,
Schema,
FAILSAFE_SCHEMA,
JSON_SCHEMA,
CORE_SCHEMA,
DEFAULT_SCHEMA,
load,
loadAll,
dump,
YAMLException,
types,
safeLoad,
safeLoadAll,
safeDump
};
// ../node_modules/vitepress-theme-teek/es/markdown/helper/cardContainer.mjs
var createCardContainers = (md, option) => {
option.forEach((item) => createCardContainer(md, item));
};
var createCardContainer = (md, option) => {
const { type: type2, className, beforeHtmlRender, htmlRender, afterHtmlRender, transformHtml } = option;
md.use(container_plugin, type2, {});
md.renderer.rules[`container_${type2}_open`] = (tokens, idx) => {
const containerToken = tokens[idx];
let html = ``;
for (let i = idx; i < tokens.length; i++) {
const token = tokens[i];
if (token.type === `container_${type2}_close`) break;
if (!["yaml", "yml"].includes(token.info)) continue;
const yamlContent = jsYaml.load(token.content.trim());
let data = [];
let config = {};
if (Array.isArray(yamlContent)) data = yamlContent;
else {
data = yamlContent.data || [];
config = yamlContent.config || {};
}
const info = containerToken.info.trim().slice(type2.length).trim();
const result = beforeHtmlRender == null ? void 0 : beforeHtmlRender({ data, config }, info, tokens, i);
if (result === false) continue;
html += htmlRender({ data, config }, info, tokens, i);
afterHtmlRender == null ? void 0 : afterHtmlRender({ data, config }, info, tokens, i);
}
html = (transformHtml == null ? void 0 : transformHtml(html)) ?? html;
return html;
};
};
// ../node_modules/vitepress-theme-teek/es/version.mjs
var version = "1.5.4";
// ../node_modules/vitepress-theme-teek/es/components/theme/ConfigProvider/index.mjs
import { useData as useData4, useRoute } from "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
// ../node_modules/vitepress-theme-teek/es/config/post/helper.mjs
var emptyPost = {
allPosts: [],
originPosts: [],
sortPostsByDateAndSticky: [],
sortPostsByDate: [],
groupPostsByYear: {},
groupPostsByYearMonth: {},
groupPosts: { categories: {}, tags: {} },
groupCards: { categories: [], tags: [] },
locales: {}
};
// ../node_modules/vitepress-theme-teek/es/components/theme/ConfigProvider/index.mjs
var postsContext = Symbol("posts");
var teekConfigContext = Symbol("teekConfig");
var TeekConfigProvider = (layout) => {
return defineComponent({
name: "TeekConfigProvider",
setup(_, { slots }) {
provide(postsContext, useAllPosts());
useAnchorScroll().startWatch();
const { getTeekConfig } = useTeekConfig();
const viewTransitionConfig = getTeekConfig("viewTransition", {
enabled: true,
mode: "out-in",
easing: "ease-in"
});
viewTransitionConfig.enabled && useViewTransition(viewTransitionConfig);
return () => h(layout, null, slots);
}
});
};
var useTeekConfig = () => {
const { theme, frontmatter } = useData4();
const teekConfigProvide = inject(teekConfigContext, {});
const getTeekConfig = (key, defaultValue) => {
var _a, _b;
let dv = defaultValue;
if (isFunction(defaultValue)) dv = defaultValue();
if (!key) {
return { ...dv, ...theme.value, ...frontmatter.value, ...frontmatter.value.tk, ...unref(teekConfigProvide) };
}
const valueFromTheme = theme.value[key];
const valueFromFrontmatter = ((_a = frontmatter.value.tk) == null ? void 0 : _a[key]) ?? frontmatter.value[key];
const valueFromInject = (_b = unref(teekConfigProvide)) == null ? void 0 : _b[key];
if (isObject2(valueFromTheme) || isObject2(valueFromFrontmatter) || isObject2(valueFromInject)) {
return { ...dv, ...valueFromTheme, ...valueFromFrontmatter, ...valueFromInject };
}
return valueFromInject ?? valueFromFrontmatter ?? valueFromTheme ?? dv;
};
const getTeekConfigRef = (key, defaultValue) => {
return computed(() => getTeekConfig(key, defaultValue));
};
return { getTeekConfig, getTeekConfigRef };
};
var usePageState = () => {
const { frontmatter } = useData4();
const isHomePage = computed(
() => !isCategoriesPage.value && !isTagsPage.value && frontmatter.value.layout === "home"
);
const isCategoriesPage = computed(() => !!frontmatter.value.categoriesPage);
const isTagsPage = computed(() => !!frontmatter.value.tagsPage);
const isArchivesPage = computed(() => !!frontmatter.value.archivesPage);
const isCataloguePage = computed(() => !!frontmatter.value.catalogue);
const isArticleOverviewPage = computed(() => !!frontmatter.value.articleOverviewPage);
const isLoginUrl = computed(() => !!frontmatter.value.loginPage);
const isRiskLinkPage = computed(() => !!frontmatter.value.riskLinkPage);
return {
isHomePage,
isCategoriesPage,
isTagsPage,
isArchivesPage,
isCataloguePage,
isArticleOverviewPage,
isLoginUrl,
isRiskLinkPage
};
};
var usePagePath = () => {
const { getTeekConfigRef } = useTeekConfig();
const { localeIndex, site } = useData4();
const posts = usePosts();
const categoryConfig = getTeekConfigRef("category", { path: "/categories" });
const tagConfig = getTeekConfigRef("tag", { path: "/tags" });
const categoryPath = computed(() => {
const localeIndexConst = localeIndex.value;
const localeName = localeIndexConst !== "root" ? `/${localeIndexConst}` : "";
return `${localeName}${categoryConfig.value.path}${site.value.cleanUrls ? "" : ".html"}`;
});
const tagPath = computed(() => {
const localeIndexConst = localeIndex.value;
const localeName = localeIndexConst !== "root" ? `/${localeIndexConst}` : "";
return `${localeName}${tagConfig.value.path}${site.value.cleanUrls ? "" : ".html"}`;
});
const postPagePath = computed(() => {
let archivesUrl = "";
let articleOverviewUrl = "";
let loginUrl = "";
let riskLinkUrl = "";
posts.value.allPosts.forEach((item) => {
const {
frontmatter: { layout, archivesPage, articleOverviewPage, loginPage, riskLinkPage },
url
} = item;
const isPageLayout = layout === "page";
if (layout === "TkCataloguePage" || isPageLayout && archivesPage === true) archivesUrl = url;
if (layout === "TkArticleOverviewPage" || isPageLayout && articleOverviewPage === true) {
articleOverviewUrl = url;
}
if (layout === false && loginPage === true) loginUrl = url;
if (layout === false && riskLinkPage === true) riskLinkUrl = url;
});
return { archivesUrl, articleOverviewUrl, loginUrl, riskLinkUrl };
});
return {
categoryPath,
tagPath,
archivesPath: computed(() => postPagePath.value.archivesUrl),
articleOverviewPath: computed(() => postPagePath.value.articleOverviewUrl),
loginPath: computed(() => postPagePath.value.loginUrl),
riskLinkPath: computed(() => postPagePath.value.riskLinkUrl)
};
};
var useAllPosts = () => {
const { theme } = useData4();
const posts = theme.value.posts;
return posts || emptyPost;
};
var usePosts = () => {
const { localeIndex } = useData4();
const posts = useAllPosts();
return computed(() => {
var _a;
return ((_a = posts.locales) == null ? void 0 : _a[localeIndex.value]) || posts;
});
};
var useTagColor = () => {
const { getTeekConfigRef } = useTeekConfig();
return getTeekConfigRef("tagColor", [
{ border: "#bfdbfe", bg: "#eff6ff", text: "#2563eb" },
{ border: "#e9d5ff", bg: "#faf5ff", text: "#9333ea" },
{ border: "#fbcfe8", bg: "#fdf2f8", text: "#db2777" },
{ border: "#a7f3d0", bg: "#ecfdf5", text: "#059669" },
{ border: "#fde68a", bg: "#fffbeb", text: "#d97706" },
{ border: "#a5f3fc", bg: "#ecfeff", text: "#0891b2" },
{ border: "#c7d2fe", bg: "#eef2ff", text: "#4f46e5" }
]);
};
var useWindowTransitionConfig = (condition) => {
const { getTeekConfigRef } = useTeekConfig();
const windowTransitionConfig = getTeekConfigRef("windowTransition", true);
return computed(() => {
const windowTransition = windowTransitionConfig.value;
if (windowTransition === void 0) return true;
return isObject2(windowTransition) ? (condition == null ? void 0 : condition(windowTransition)) ?? true : windowTransition !== false;
});
};
var useCommon = () => {
const isMobile = useMediaQuery("(max-width: 768px)");
return { isMobile };
};
var useSidebar = () => {
const hasSidebar = ref(true);
const route = useRoute();
watch(
() => route.path,
async () => {
if (!isClient) return;
await nextTick();
const sidebarDom = document.querySelector(".VPSidebar");
if (sidebarDom) hasSidebar.value = true;
else hasSidebar.value = false;
},
{ immediate: true, flush: "post" }
);
return { hasSidebar };
};
// ../node_modules/vitepress-theme-teek/es/components/theme/CataloguePage/src/index.vue2.mjs
import { useData as useData6 } from "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
// ../node_modules/vitepress-theme-teek/es/components/common/ArticlePage/src/index.vue2.mjs
import "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
// ../node_modules/vitepress-theme-teek/es/components/common/ArticlePage/src/components/DocAsideOutline.vue2.mjs
import { useData as useData5, onContentUpdated } from "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
// ../node_modules/vitepress-theme-teek/es/components/common/ArticlePage/src/components/outline.mjs
import { getScrollOffset } from "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
var ignoreRE = /\b(?:VPBadge|header-anchor|footnote-ref|ignore-header)\b/;
var resolvedHeaders = [];
function resolveTitle(theme) {
return typeof theme.outline === "object" && !Array.isArray(theme.outline) && theme.outline.label || "On this page";
}
function getHeaders(range) {
const ns4 = useNamespace();
const headers = [...document.querySelectorAll(`.${ns4.join("article-page")} :where(h1,h2,h3,h4,h5,h6)`)].filter((el) => el.id && el.hasChildNodes()).map((el) => {
const level = Number(el.tagName[1]);
return {
element: el,
title: serializeHeader(el),
link: "#" + el.id,
level
};
});
return resolveHeaders(headers, range);
}
function serializeHeader(h2) {
let ret = "";
for (const node of h2.childNodes) {
if (node.nodeType === 1) {
if (ignoreRE.test(node.className)) continue;
ret += node.textContent;
} else if (node.nodeType === 3) {
ret += node.textContent;
}
}
return ret.trim();
}
function resolveHeaders(headers, range) {
if (range === false) {
return [];
}
const levelsRange = (typeof range === "object" && !Array.isArray(range) ? range.level : range) || 2;
const [high, low] = typeof levelsRange === "number" ? [levelsRange, levelsRange] : levelsRange === "deep" ? [2, 6] : levelsRange;
return buildTree(headers, high, low);
}
var useActiveAnchor = (container, marker) => {
const is1280 = useMediaQuery("(min-width: 1280px)");
const onScroll = useDebounce(setActiveLink, 100);
let prevActiveLink = null;
onMounted(() => {
requestAnimationFrame(setActiveLink);
window.addEventListener("scroll", onScroll);
});
onUpdated(() => {
activateLink(location.hash);
});
onUnmounted(() => {
window.removeEventListener("scroll", onScroll);
});
function setActiveLink() {
if (!is1280.value) return;
const scrollY = window.scrollY;
const innerHeight2 = window.innerHeight;
const offsetHeight = document.body.offsetHeight;
const isBottom = Math.abs(scrollY + innerHeight2 - offsetHeight) < 1;
const headers = resolvedHeaders.map(({ element, link }) => ({
link,
top: getAbsoluteTop(element)
})).filter(({ top }) => !Number.isNaN(top)).sort((a, b) => a.top - b.top);
if (!headers.length) {
activateLink(null);
return;
}
if (scrollY < 1) {
activateLink(null);
return;
}
if (isBottom) {
activateLink(headers[headers.length - 1].link);
return;
}
let activeLink = null;
for (const { link, top } of headers) {
if (top > scrollY + getScrollOffset() + 4) break;
activeLink = link;
}
activateLink(activeLink);
}
function activateLink(hash) {
if (prevActiveLink) prevActiveLink.classList.remove("active");
if (hash == null) prevActiveLink = null;
else prevActiveLink = container.value.querySelector(`a[href="${decodeURIComponent(hash)}"]`);
const activeLink = prevActiveLink;
if (activeLink) {
activeLink.classList.add("active");
marker.value.style.top = activeLink.offsetTop + 39 + "px";
marker.value.style.opacity = "1";
} else {
marker.value.style.top = "33px";
marker.value.style.opacity = "0";
}
}
};
function getAbsoluteTop(element) {
let offsetTop = 0;
while (element !== document.body) {
if (element === null) {
return NaN;
}
offsetTop += element.offsetTop;
element = element.offsetParent;
}
return offsetTop;
}
function buildTree(data, min, max) {
resolvedHeaders.length = 0;
const result = [];
const stack2 = [];
data.forEach((item) => {
const node = { ...item, children: [] };
let parent = stack2[stack2.length - 1];
while (parent && parent.level >= node.level) {
stack2.pop();
parent = stack2[stack2.length - 1];
}
if (node.element.classList.contains("ignore-header") || parent && "shouldIgnore" in parent) {
stack2.push({ level: node.level, shouldIgnore: true });
return;
}
if (node.level > max || node.level < min) return;
resolvedHeaders.push({ element: node.element, link: node.link });
if (parent) parent.children.push(node);
else result.push(node);
stack2.push(node);
});
return result;
}
// ../node_modules/vitepress-theme-teek/es/components/common/ArticlePage/src/components/DocAsideOutlineItem.vue2.mjs
import "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
var _hoisted_1 = ["href", "title"];
var _sfc_main = defineComponent({
...{ name: "DocAsideOutlineItem" },
__name: "DocAsideOutlineItem",
props: {
headers: {},
root: { type: Boolean }
},
setup(__props) {
const ns4 = useNamespace("aside-outline-item");
function onClick({ target: el }) {
const id = el.href.split("#")[1];
const heading = document.getElementById(decodeURIComponent(id));
heading == null ? void 0 : heading.focus({ preventScroll: true });
}
return (_ctx, _cache) => {
const _component_DocAsideOutlineItem = resolveComponent("DocAsideOutlineItem", true);
return openBlock(), createElementBlock(
"ul",
{
class: normalizeClass([unref(ns4).b(), __props.root ? unref(ns4).is("root") : unref(ns4).is("nested")])
},
[
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.headers, ({ children, link, title }) => {
return openBlock(), createElementBlock("li", { key: link }, [
createBaseVNode("a", {
class: normalizeClass(unref(ns4).m("link")),
href: link,
onClick,
title
}, toDisplayString(title), 11, _hoisted_1),
(children == null ? void 0 : children.length) ? (openBlock(), createBlock(_component_DocAsideOutlineItem, {
key: 0,
headers: children
}, null, 8, ["headers"])) : createCommentVNode("v-if", true)
]);
}),
128
/* KEYED_FRAGMENT */
))
],
2
/* CLASS */
);
};
}
});
// ../node_modules/vitepress-theme-teek/es/components/common/ArticlePage/src/components/DocAsideOutline.vue2.mjs
var _sfc_main2 = defineComponent({
...{ name: "DocAsideOutline" },
__name: "DocAsideOutline",
setup(__props) {
const ns4 = useNamespace("aside-outline");
const { frontmatter, theme } = useData5();
const headers = shallowRef([]);
onContentUpdated(() => {
headers.value = getHeaders(frontmatter.value.outline ?? theme.value.outline);
});
onMounted(() => {
var _a;
if (!((_a = headers.value) == null ? void 0 : _a.length)) headers.value = getHeaders(frontmatter.value.outline ?? theme.value.outline);
});
const container = ref();
const marker = ref();
useActiveAnchor(container, marker);
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"nav",
{
"aria-labelledby": "doc-outline-aria-label",
class: normalizeClass([unref(ns4).b(), { "has-outline": headers.value.length > 0 }]),
ref_key: "container",
ref: container
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns4).e("content"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns4).m("marker")),
ref_key: "marker",
ref: marker
},
null,
2
/* CLASS */
),
createBaseVNode(
"div",
{
id: "doc-outline-aria-label",
"aria-level": "2",
class: normalizeClass(unref(ns4).m("title")),
role: "heading"
},
toDisplayString(unref(resolveTitle)(unref(theme))),
3
/* TEXT, CLASS */
),
createVNode(_sfc_main, {
headers: headers.value,
root: true
}, null, 8, ["headers"])
],
2
/* CLASS */
)
],
2
/* CLASS */
);
};
}
});
// ../node_modules/vitepress-theme-teek/es/components/common/ArticlePage/src/index.vue2.mjs
var _sfc_main3 = defineComponent({
...{ name: "ArticlePage" },
__name: "index",
props: {
doc: { type: Boolean },
aside: { type: Boolean }
},
setup(__props) {
const ns4 = useNamespace("article-page");
return (_ctx, _cache) => {
return openBlock(), createElementBlock(
"div",
{
class: normalizeClass([unref(ns4).b(), unref(ns4).is("aside", __props.aside)])
},
[
__props.aside ? (openBlock(), createElementBlock(
"div",
{
key: 0,
class: normalizeClass(unref(ns4).e("aside"))
},
[
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns4).e("aside__container"))
},
[
createVNode(_sfc_main2)
],
2
/* CLASS */
)
],
2
/* CLASS */
)) : createCommentVNode("v-if", true),
createBaseVNode(
"div",
{
class: normalizeClass([unref(ns4).join("doc"), { "vp-doc": __props.doc }])
},
[
createBaseVNode("div", null, [
renderSlot(_ctx.$slots, "default")
])
],
2
/* CLASS */
)
],
2
/* CLASS */
);
};
}
});
// ../node_modules/vitepress-theme-teek/es/components/theme/CataloguePage/src/CatalogueItem.vue2.mjs
import { withBase as withBase2 } from "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
// ../node_modules/vitepress-theme-teek/es/components/common/TitleTag/src/index.vue2.mjs
import "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
var _sfc_main4 = defineComponent({
...{ name: "TitleTag" },
__name: "index",
props: {
text: {},
type: {},
position: {},
size: {}
},
setup(__props) {
const ns4 = useNamespace("title-tag");
return (_ctx, _cache) => {
return __props.text || _ctx.$slots.default ? (openBlock(), createElementBlock(
"span",
{
key: 0,
class: normalizeClass([unref(ns4).b(), __props.type && unref(ns4).m(__props.type), __props.position && unref(ns4).m(__props.position), __props.size && unref(ns4).m(__props.size)])
},
[
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(
toDisplayString(__props.text),
1
/* TEXT */
)
])
],
2
/* CLASS */
)) : createCommentVNode("v-if", true);
};
}
});
// ../node_modules/vitepress-theme-teek/es/components/theme/CataloguePage/src/CatalogueItem.vue2.mjs
var _hoisted_12 = ["href", "aria-label"];
var _hoisted_2 = ["innerHTML"];
var _hoisted_3 = ["id", "aria-labelledby"];
var _hoisted_4 = ["href", "aria-label"];
var _hoisted_5 = ["id"];
var _hoisted_6 = ["aria-label"];
var _sfc_main5 = defineComponent({
...{ name: "CatalogueItem" },
__name: "CatalogueItem",
props: {
item: {},
index: {}
},
setup(__props) {
const nsSub = useNamespace("sub-catalogue");
const nsItem = useNamespace("catalogue-item");
return (_ctx, _cache) => {
var _a, _b, _c;
const _component_CatalogueItem = resolveComponent("CatalogueItem", true);
return openBlock(), createElementBlock(
"li",
{
class: normalizeClass(__props.item.children ? unref(nsSub).b() : unref(nsItem).b())
},
[
!__props.item.children ? (openBlock(), createElementBlock("a", {
key: 0,
href: __props.item.url && unref(withBase2)(__props.item.url),
"aria-label": `${__props.index}. ${__props.item.title}`
}, [
createTextVNode(
toDisplayString(__props.index) + ". ",
1
/* TEXT */
),
createBaseVNode("span", {
innerHTML: __props.item.title
}, null, 8, _hoisted_2),
((_a = __props.item.frontmatter) == null ? void 0 : _a.titleTag) ? (openBlock(), createBlock(unref(_sfc_main4), {
key: 0,
text: (_b = __props.item.frontmatter) == null ? void 0 : _b.titleTag,
position: "right",
size: "small",
"aria-label": (_c = __props.item.frontmatter) == null ? void 0 : _c.titleTag
}, null, 8, ["text", "aria-label"])) : createCommentVNode("v-if", true)
], 8, _hoisted_12)) : __props.item.children.length ? (openBlock(), createElementBlock(
Fragment,
{ key: 1 },
[
createBaseVNode("div", {
id: __props.item.title,
class: normalizeClass(unref(nsSub).e("title")),
role: "group",
"aria-labelledby": `${__props.item.title}-label`
}, [
createBaseVNode("a", {
href: `#${__props.item.title}`,
class: "anchor",
"aria-label": __props.item.title
}, "#", 8, _hoisted_4),
createBaseVNode("span", {
id: `${__props.item.title}-label`
}, toDisplayString(`${__props.index}. ${__props.item.title}`), 9, _hoisted_5)
], 10, _hoisted_3),
__props.item.children ? (openBlock(), createElementBlock("ul", {
key: 0,
class: normalizeClass(`${unref(nsSub).e("inline")} flx-wrap-between`),
"aria-label": __props.item.title
}, [
createCommentVNode(" 递归自己 "),
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(__props.item.children, (item, i) => {
return openBlock(), createBlock(_component_CatalogueItem, {
key: i,
item,
index: `${__props.index}-${i + 1}`
}, null, 8, ["item", "index"]);
}),
128
/* KEYED_FRAGMENT */
))
], 10, _hoisted_6)) : createCommentVNode("v-if", true)
],
64
/* STABLE_FRAGMENT */
)) : createCommentVNode("v-if", true)
],
2
/* CLASS */
);
};
}
});
// ../node_modules/vitepress-theme-teek/es/components/theme/CataloguePage/src/index.vue2.mjs
var _hoisted_13 = { id: "catalogue-header-title" };
var _hoisted_22 = { class: "description" };
var _hoisted_32 = {
id: "catalogue-list-title",
class: "title"
};
var _hoisted_42 = { class: "flx-wrap-between" };
var _hoisted_52 = { class: "vp-doc" };
var _sfc_main6 = defineComponent({
...{ name: "CataloguePage" },
__name: "index",
setup(__props) {
const ns4 = useNamespace("catalogue");
const { t } = useLocale();
const { theme, frontmatter } = useData6();
const catalogues = computed(() => {
var _a, _b;
return (_b = (_a = theme.value.catalogues) == null ? void 0 : _a.inv[frontmatter.value.path]) == null ? void 0 : _b.catalogues;
});
return (_ctx, _cache) => {
const _component_Content = resolveComponent("Content");
return openBlock(), createBlock(unref(_sfc_main3), {
class: normalizeClass(unref(ns4).b()),
"aria-label": unref(t)("tk.catalogue.label")
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "teek-catalogue-top-before"),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns4).e("header")),
role: "group",
"aria-labelledby": "catalogue-header-title"
},
[
createBaseVNode(
"h2",
_hoisted_13,
toDisplayString(unref(frontmatter).title),
1
/* TEXT */
),
createBaseVNode(
"div",
_hoisted_22,
toDisplayString(unref(frontmatter).desc || unref(frontmatter).description),
1
/* TEXT */
)
],
2
/* CLASS */
),
renderSlot(_ctx.$slots, "teek-catalogue-top-after"),
createBaseVNode(
"div",
{
class: normalizeClass(unref(ns4).e("wrapper")),
"aria-labelledby": "catalogue-list-title"
},
[
createBaseVNode(
"div",
_hoisted_32,
toDisplayString(unref(frontmatter).pageTitle || unref(t)("tk.catalogue.title")),
1
/* TEXT */
),
createBaseVNode("ul", _hoisted_42, [
(openBlock(true), createElementBlock(
Fragment,
null,
renderList(catalogues.value, (item, index2) => {
return openBlock(), createBlock(_sfc_main5, {
key: index2,
item,
index: index2 + 1
}, null, 8, ["item", "index"]);
}),
128
/* KEYED_FRAGMENT */
))
])
],
2
/* CLASS */
),
createBaseVNode("div", _hoisted_52, [
createVNode(_component_Content)
])
]),
_: 3
/* FORWARDED */
}, 8, ["class", "aria-label"]);
};
}
});
// ../node_modules/vitepress-theme-teek/es/components/theme/ArchivesPage/src/index.vue2.mjs
import { useData as useData7, withBase as withBase3 } from "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
// ../node_modules/vitepress-theme-teek/es/components/theme/ArticleTitle/src/index.vue2.mjs
import "vitepress";
import "/workspaces/frontend/node_modules/vitepress-theme-teek/theme-chalk/tk-copy-banner.css";
// ../node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js
var FRAGMENT = Symbol(true ? `Fragment` : ``);
var TELEPORT = Symbol(true ? `Teleport` : ``);
var SUSPENSE = Symbol(true ? `Suspense` : ``);
var KEEP_ALIVE = Symbol(true ? `KeepAlive` : ``);
var BASE_TRANSITION = Symbol(
true ? `BaseTransition` : ``
);
var OPEN_BLOCK = Symbol(true ? `openBlock` : ``);
var CREATE_BLOCK = Symbol(true ? `createBlock` : ``);
var CREATE_ELEMENT_BLOCK = Symbol(
true ? `createElementBlock` : ``
);
var CREATE_VNODE = Symbol(true ? `createVNode` : ``);
var CREATE_ELEMENT_VNODE = Symbol(
true ? `createElementVNode` : ``
);
var CREATE_COMMENT = Symbol(
true ? `createCommentVNode` : ``
);
var CREATE_TEXT = Symbol(
true ? `createTextVNode` : ``
);
var CREATE_STATIC = Symbol(
true ? `createStaticVNode` : ``
);
var RESOLVE_COMPONENT = Symbol(
true ? `resolveComponent` : ``
);
var RESOLVE_DYNAMIC_COMPONENT = Symbol(
true ? `resolveDynamicComponent` : ``
);
var RESOLVE_DIRECTIVE = Symbol(
true ? `resolveDirective` : ``
);
var RESOLVE_FILTER = Symbol(
true ? `resolveFilter` : ``
);
var WITH_DIRECTIVES = Symbol(
true ? `withDirectives` : ``
);
var RENDER_LIST = Symbol(true ? `renderList` : ``);
var RENDER_SLOT = Symbol(true ? `renderSlot` : ``);
var CREATE_SLOTS = Symbol(true ? `createSlots` : ``);
var TO_DISPLAY_STRING = Symbol(
true ? `toDisplayString` : ``
);
var MERGE_PROPS = Symbol(true ? `mergeProps` : ``);
var NORMALIZE_CLASS = Symbol(
true ? `normalizeClass` : ``
);
var NORMALIZE_STYLE = Symbol(
true ? `normalizeStyle` : ``
);
var NORMALIZE_PROPS = Symbol(
true ? `normalizeProps` : ``
);
var GUARD_REACTIVE_PROPS = Symbol(
true ? `guardReactiveProps` : ``
);
var TO_HANDLERS = Symbol(true ? `toHandlers` : ``);
var CAMELIZE = Symbol(true ? `camelize` : ``);
var CAPITALIZE = Symbol(true ? `capitalize` : ``);
var TO_HANDLER_KEY = Symbol(
true ? `toHandlerKey` : ``
);
var SET_BLOCK_TRACKING = Symbol(
true ? `setBlockTracking` : ``
);
var PUSH_SCOPE_ID = Symbol(true ? `pushScopeId` : ``);
var POP_SCOPE_ID = Symbol(true ? `popScopeId` : ``);
var WITH_CTX = Symbol(true ? `withCtx` : ``);
var UNREF = Symbol(true ? `unref` : ``);
var IS_REF = Symbol(true ? `isRef` : ``);
var WITH_MEMO = Symbol(true ? `withMemo` : ``);
var IS_MEMO_SAME = Symbol(true ? `isMemoSame` : ``);
var helperNameMap = {
[FRAGMENT]: `Fragment`,
[TELEPORT]: `Teleport`,
[SUSPENSE]: `Suspense`,
[KEEP_ALIVE]: `KeepAlive`,
[BASE_TRANSITION]: `BaseTransition`,
[OPEN_BLOCK]: `openBlock`,
[CREATE_BLOCK]: `createBlock`,
[CREATE_ELEMENT_BLOCK]: `createElementBlock`,
[CREATE_VNODE]: `createVNode`,
[CREATE_ELEMENT_VNODE]: `createElementVNode`,
[CREATE_COMMENT]: `createCommentVNode`,
[CREATE_TEXT]: `createTextVNode`,
[CREATE_STATIC]: `createStaticVNode`,
[RESOLVE_COMPONENT]: `resolveComponent`,
[RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,
[RESOLVE_DIRECTIVE]: `resolveDirective`,
[RESOLVE_FILTER]: `resolveFilter`,
[WITH_DIRECTIVES]: `withDirectives`,
[RENDER_LIST]: `renderList`,
[RENDER_SLOT]: `renderSlot`,
[CREATE_SLOTS]: `createSlots`,
[TO_DISPLAY_STRING]: `toDisplayString`,
[MERGE_PROPS]: `mergeProps`,
[NORMALIZE_CLASS]: `normalizeClass`,
[NORMALIZE_STYLE]: `normalizeStyle`,
[NORMALIZE_PROPS]: `normalizeProps`,
[GUARD_REACTIVE_PROPS]: `guardReactiveProps`,
[TO_HANDLERS]: `toHandlers`,
[CAMELIZE]: `camelize`,
[CAPITALIZE]: `capitalize`,
[TO_HANDLER_KEY]: `toHandlerKey`,
[SET_BLOCK_TRACKING]: `setBlockTracking`,
[PUSH_SCOPE_ID]: `pushScopeId`,
[POP_SCOPE_ID]: `popScopeId`,
[WITH_CTX]: `withCtx`,
[UNREF]: `unref`,
[IS_REF]: `isRef`,
[WITH_MEMO]: `withMemo`,
[IS_MEMO_SAME]: `isMemoSame`
};
function registerRuntimeHelpers(helpers) {
Object.getOwnPropertySymbols(helpers).forEach((s) => {
helperNameMap[s] = helpers[s];
});
}
var locStub = {
start: { line: 1, column: 1, offset: 0 },
end: { line: 1, column: 1, offset: 0 },
source: ""
};
function createRoot(children, source = "") {
return {
type: 0,
source,
children,
helpers: /* @__PURE__ */ new Set(),
components: [],
directives: [],
hoists: [],
imports: [],
cached: [],
temps: 0,
codegenNode: void 0,
loc: locStub
};
}
function createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent2 = false, loc = locStub) {
if (context) {
if (isBlock) {
context.helper(OPEN_BLOCK);
context.helper(getVNodeBlockHelper(context.inSSR, isComponent2));
} else {
context.helper(getVNodeHelper(context.inSSR, isComponent2));
}
if (directives) {
context.helper(WITH_DIRECTIVES);
}
}
return {
type: 13,
tag,
props,
children,
patchFlag,
dynamicProps,
directives,
isBlock,
disableTracking,
isComponent: isComponent2,
loc
};
}
function createArrayExpression(elements, loc = locStub) {
return {
type: 17,
loc,
elements
};
}
function createObjectExpression(properties, loc = locStub) {
return {
type: 15,
loc,
properties
};
}
function createObjectProperty(key, value) {
return {
type: 16,
loc: locStub,
key: isString(key) ? createSimpleExpression(key, true) : key,
value
};
}
function createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0) {
return {
type: 4,
loc,
content,
isStatic,
constType: isStatic ? 3 : constType
};
}
function createCompoundExpression(children, loc = locStub) {
return {
type: 8,
loc,
children
};
}
function createCallExpression(callee, args = [], loc = locStub) {
return {
type: 14,
loc,
callee,
arguments: args
};
}
function createFunctionExpression(params, returns = void 0, newline = false, isSlot = false, loc = locStub) {
return {
type: 18,
params,
returns,
newline,
isSlot,
loc
};
}
function createConditionalExpression(test, consequent, alternate, newline = true) {
return {
type: 19,
test,
consequent,
alternate,
newline,
loc: locStub
};
}
function createCacheExpression(index2, value, needPauseTracking = false, inVOnce = false) {
return {
type: 20,
index: index2,
value,
needPauseTracking,
inVOnce,
needArraySpread: false,
loc: locStub
};
}
function createBlockStatement(body) {
return {
type: 21,
body,
loc: locStub
};
}
function getVNodeHelper(ssr, isComponent2) {
return ssr || isComponent2 ? CREATE_VNODE : CREATE_ELEMENT_VNODE;
}
function getVNodeBlockHelper(ssr, isComponent2) {
return ssr || isComponent2 ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;
}
function convertToBlock(node, { helper, removeHelper, inSSR }) {
if (!node.isBlock) {
node.isBlock = true;
removeHelper(getVNodeHelper(inSSR, node.isComponent));
helper(OPEN_BLOCK);
helper(getVNodeBlockHelper(inSSR, node.isComponent));
}
}
var defaultDelimitersOpen = new Uint8Array([123, 123]);
var defaultDelimitersClose = new Uint8Array([125, 125]);
function isTagStartChar(c) {
return c >= 97 && c <= 122 || c >= 65 && c <= 90;
}
function isWhitespace2(c) {
return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;
}
function isEndOfTagSection(c) {
return c === 47 || c === 62 || isWhitespace2(c);
}
function toCharCodes(str2) {
const ret = new Uint8Array(str2.length);
for (let i = 0; i < str2.length; i++) {
ret[i] = str2.charCodeAt(i);
}
return ret;
}
var Sequences = {
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
// CDATA[
CdataEnd: new Uint8Array([93, 93, 62]),
// ]]>
CommentEnd: new Uint8Array([45, 45, 62]),
// `-->`
ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
// `<\/script`
StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
// `= 0; i--) {
const newlineIndex = this.newlines[i];
if (index2 > newlineIndex) {
line = i + 2;
column = index2 - newlineIndex;
break;
}
}
return {
column,
line,
offset: index2
};
}
peek() {
return this.buffer.charCodeAt(this.index + 1);
}
stateText(c) {
if (c === 60) {
if (this.index > this.sectionStart) {
this.cbs.ontext(this.sectionStart, this.index);
}
this.state = 5;
this.sectionStart = this.index;
} else if (!this.inVPre && c === this.delimiterOpen[0]) {
this.state = 2;
this.delimiterIndex = 0;
this.stateInterpolationOpen(c);
}
}
stateInterpolationOpen(c) {
if (c === this.delimiterOpen[this.delimiterIndex]) {
if (this.delimiterIndex === this.delimiterOpen.length - 1) {
const start = this.index + 1 - this.delimiterOpen.length;
if (start > this.sectionStart) {
this.cbs.ontext(this.sectionStart, start);
}
this.state = 3;
this.sectionStart = start;
} else {
this.delimiterIndex++;
}
} else if (this.inRCDATA) {
this.state = 32;
this.stateInRCDATA(c);
} else {
this.state = 1;
this.stateText(c);
}
}
stateInterpolation(c) {
if (c === this.delimiterClose[0]) {
this.state = 4;
this.delimiterIndex = 0;
this.stateInterpolationClose(c);
}
}
stateInterpolationClose(c) {
if (c === this.delimiterClose[this.delimiterIndex]) {
if (this.delimiterIndex === this.delimiterClose.length - 1) {
this.cbs.oninterpolation(this.sectionStart, this.index + 1);
if (this.inRCDATA) {
this.state = 32;
} else {
this.state = 1;
}
this.sectionStart = this.index + 1;
} else {
this.delimiterIndex++;
}
} else {
this.state = 3;
this.stateInterpolation(c);
}
}
stateSpecialStartSequence(c) {
const isEnd = this.sequenceIndex === this.currentSequence.length;
const isMatch = isEnd ? (
// If we are at the end of the sequence, make sure the tag name has ended
isEndOfTagSection(c)
) : (
// Otherwise, do a case-insensitive comparison
(c | 32) === this.currentSequence[this.sequenceIndex]
);
if (!isMatch) {
this.inRCDATA = false;
} else if (!isEnd) {
this.sequenceIndex++;
return;
}
this.sequenceIndex = 0;
this.state = 6;
this.stateInTagName(c);
}
/** Look for an end tag. For
and