valaxy 0.3.11 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README.md +0 -4
  2. package/{src/client → client}/App.vue +0 -0
  3. package/{src/client/composables/search/index.ts → client/app/data.ts} +0 -0
  4. package/{src/client → client}/components/AppLink.vue +0 -0
  5. package/client/components/PostCard.vue +84 -0
  6. package/{src/client → client}/components/PostList.vue +0 -0
  7. package/{src/client → client}/components/README.md +0 -0
  8. package/{src/client → client}/components/ValaxyBg.vue +0 -0
  9. package/{src/client → client}/components/ValaxyCopyright.vue +0 -0
  10. package/{src/client → client}/components/ValaxyFooter.vue +1 -1
  11. package/{src/client → client}/components/ValaxyHamburger.vue +0 -0
  12. package/{src/client → client}/components/ValaxyMd.vue +1 -5
  13. package/{src/client → client}/components/ValaxyOverlay.vue +0 -0
  14. package/{src/client → client}/components/ValaxyPagination.vue +0 -0
  15. package/{src/client → client}/components/ValaxyRightSidebar.vue +0 -0
  16. package/{src/client → client}/components/ValaxySidebar.vue +0 -0
  17. package/{src/client → client}/components/ValaxyToc.vue +3 -3
  18. package/{src/client → client}/composables/category.ts +0 -0
  19. package/{src/client → client}/composables/comments/index.ts +0 -0
  20. package/{src/client → client}/composables/comments/twikoo.ts +0 -0
  21. package/{src/client → client}/composables/comments/waline.ts +0 -0
  22. package/{src/client → client}/composables/common.ts +0 -0
  23. package/{src/client → client}/composables/dark.ts +0 -0
  24. package/client/composables/features/index.ts +0 -0
  25. package/{src/client → client}/composables/helper.ts +0 -0
  26. package/{src/client → client}/composables/index.ts +1 -1
  27. package/{src/client → client}/composables/layout.ts +0 -0
  28. package/client/composables/outline.ts +181 -0
  29. package/{src/client → client}/composables/post.ts +0 -0
  30. package/client/composables/search/index.ts +0 -0
  31. package/{src/client → client}/composables/sidebar.ts +68 -9
  32. package/{src/client → client}/composables/tag.ts +0 -0
  33. package/{src/client → client}/composables/widgets/aplayer.ts +0 -0
  34. package/{src/client → client}/composables/widgets/backToTop.ts +0 -0
  35. package/{src/client → client}/composables/widgets/codepen.ts +0 -0
  36. package/{src/client → client}/composables/widgets/index.ts +0 -0
  37. package/client/config.ts +75 -0
  38. package/{src/client → client}/index.html +0 -0
  39. package/{src/client → client}/index.ts +0 -0
  40. package/{src/client → client}/layouts/404.vue +0 -0
  41. package/{src/client → client}/layouts/README.md +0 -0
  42. package/{src/client → client}/locales/README.md +0 -0
  43. package/{src/client → client}/locales/en.yml +1 -0
  44. package/{src/client → client}/locales/zh-CN.yml +4 -3
  45. package/{src/client → client}/main.ts +8 -1
  46. package/{src/client → client}/modules/README.md +0 -0
  47. package/{src/client → client}/modules/nprogress.ts +0 -0
  48. package/{src/client → client}/modules/pinia.ts +0 -0
  49. package/{src/client → client}/modules/valaxy.ts +34 -9
  50. package/{src/client → client}/pages/README.md +0 -0
  51. package/{src/client → client}/pages/[...all].vue +0 -0
  52. package/{src/client → client}/pages/hi/[name].vue +0 -0
  53. package/{src/client → client}/pages/index.vue +0 -0
  54. package/{src/client → client}/pages/page/[page].vue +0 -0
  55. package/{src/client → client}/shims.d.ts +7 -1
  56. package/{src/client → client}/stores/app.ts +0 -0
  57. package/{src/client → client}/stores/user.ts +0 -0
  58. package/{src/client → client}/styles/common/button.scss +0 -0
  59. package/{src/client → client}/styles/common/code.scss +0 -0
  60. package/{src/client → client}/styles/common/custom-blocks.scss +0 -0
  61. package/{src/client → client}/styles/common/hamburger.scss +0 -0
  62. package/{src/client → client}/styles/common/markdown.scss +5 -1
  63. package/client/styles/common/scrollbar.scss +28 -0
  64. package/{src/client → client}/styles/common/sidebar.scss +0 -0
  65. package/{src/client → client}/styles/common/transition.scss +0 -0
  66. package/{src/client → client}/styles/css-vars.scss +0 -0
  67. package/{src/client → client}/styles/global/helper.scss +0 -0
  68. package/{src/client → client}/styles/global/i18n.scss +0 -0
  69. package/{src/client → client}/styles/global/index.scss +0 -0
  70. package/{src/client → client}/styles/global/nprogress.scss +0 -0
  71. package/{src/client → client}/styles/global/reset.scss +0 -0
  72. package/{src/client → client}/styles/index.scss +0 -0
  73. package/{src/client → client}/styles/mixins/config.scss +0 -0
  74. package/{src/client → client}/styles/mixins/index.scss +0 -0
  75. package/{src/client → client}/styles/mixins/size.scss +0 -0
  76. package/{src/client → client}/styles/mixins/variable.scss +0 -0
  77. package/{src/client → client}/styles/palette.scss +6 -2
  78. package/client/styles/third/katex.scss +3 -0
  79. package/{src/client → client}/styles/vars.scss +0 -0
  80. package/{src/client → client}/styles/widgets/banner.scss +0 -0
  81. package/{src/client → client}/types.ts +0 -0
  82. package/{src/client → client}/utils/helper.ts +22 -0
  83. package/{src/client → client}/utils/index.ts +0 -0
  84. package/client/utils/sidebar.ts +26 -0
  85. package/{src/client → client}/utils/time.ts +0 -0
  86. package/config/index.ts +18 -0
  87. package/dist/chunk-CP3UCJ2D.js +34 -0
  88. package/dist/chunk-EAN2KU6W.mjs +1 -0
  89. package/dist/chunk-HCVZ2UUO.mjs +34 -0
  90. package/dist/chunk-U5OMNIOK.js +1 -0
  91. package/dist/{config-de04677b.d.ts → config-ad23e743.d.ts} +28 -14
  92. package/dist/index.d.ts +67 -111
  93. package/dist/index.js +1 -1
  94. package/dist/index.mjs +1 -1
  95. package/dist/node/cli.js +7 -11
  96. package/dist/node/cli.mjs +7 -11
  97. package/dist/node/index.d.ts +2 -2
  98. package/dist/node/index.js +1 -1
  99. package/dist/node/index.mjs +1 -1
  100. package/{src/index.ts → index.ts} +1 -0
  101. package/{src/node → node}/build.ts +0 -0
  102. package/{src/node → node}/cli.ts +3 -2
  103. package/node/config.ts +156 -0
  104. package/{src/node → node}/index.ts +0 -0
  105. package/{src/node → node}/markdown/check.ts +0 -0
  106. package/{src/node → node}/markdown/highlight.ts +0 -0
  107. package/{src/node → node}/markdown/index.ts +21 -13
  108. package/{src/node → node}/markdown/markdown-it/container.ts +0 -0
  109. package/{src/node → node}/markdown/markdown-it/headings.ts +0 -0
  110. package/{src/node → node}/markdown/markdown-it/highlightLines.ts +0 -0
  111. package/{src/node → node}/markdown/markdown-it/katex.ts +0 -0
  112. package/{src/node → node}/markdown/markdown-it/parseHeader.ts +0 -0
  113. package/node/markdown/markdownToVue.ts +253 -0
  114. package/{src/node → node}/markdown/slugify.ts +0 -0
  115. package/{src/node → node}/options.ts +18 -2
  116. package/{src/node → node}/plugins/extendConfig.ts +6 -3
  117. package/node/plugins/index.ts +224 -0
  118. package/{src/node → node}/plugins/preset.ts +6 -36
  119. package/{src/node → node}/plugins/unocss.ts +0 -0
  120. package/{src/node → node}/plugins/valaxy.ts +0 -0
  121. package/{src/node → node}/rss.ts +1 -1
  122. package/{src/node → node}/server.ts +6 -4
  123. package/{src/node → node}/shims.d.ts +0 -0
  124. package/{src/node → node}/utils/cli.ts +1 -1
  125. package/node/utils/getGitTimestamp.ts +13 -0
  126. package/node/utils/index.ts +59 -0
  127. package/node/utils/net.ts +20 -0
  128. package/{src/node → node}/vite.ts +5 -1
  129. package/package.json +33 -13
  130. package/shared/index.ts +1 -0
  131. package/tsup.config.ts +7 -4
  132. package/{src/types → types}/config.ts +31 -108
  133. package/types/data.ts +31 -0
  134. package/{src/types → types}/index.ts +1 -0
  135. package/{src/types → types}/posts.ts +6 -1
  136. package/dist/chunk-6LIOFBAA.mjs +0 -1
  137. package/dist/chunk-ABPVSNYI.js +0 -83
  138. package/dist/chunk-QOANGHSR.mjs +0 -83
  139. package/dist/chunk-V3BMKLEW.js +0 -1
  140. package/src/client/components/PostCard.vue +0 -68
  141. package/src/client/composables/features/index.ts +0 -1
  142. package/src/client/composables/features/katex.ts +0 -15
  143. package/src/client/composables/search/algolia.ts +0 -115
  144. package/src/client/config.ts +0 -51
  145. package/src/client/modules/pwa.ts +0 -12
  146. package/src/client/styles/common/scrollbar.scss +0 -34
  147. package/src/node/config.ts +0 -52
  148. package/src/node/plugins/index.ts +0 -120
  149. package/src/node/plugins/markdown.ts +0 -57
  150. package/src/node/utils/index.ts +0 -26
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{a as x,b as v,f as xt}from"./chunk-6LIOFBAA.mjs";import S from"@valaxyjs/config";import{computed as w,inject as D,readonly as O,shallowRef as V}from"vue";function C(t){let e=JSON.parse(t);return import.meta.env.DEV?O(e):e}var U=Symbol("valaxy:config"),T=V(C(S));import.meta.hot&&import.meta.hot.accept("/@valaxyjs/config",t=>{T.value=C(t.default)});function Ct(){return w(()=>T.value)}function g(){let t=D(U);if(!t)throw new Error("[Valaxy] config not properly injected in qpp");return t}function P(){let t=g();return w(()=>t.value.themeConfig)}import{unref as N}from"vue";import{computed as p}from"vue";import{useRoute as z,useRouter as b}from"vue-router";import{useI18n as I}from"vue-i18n";function Pt(t,e){return Math.random()*(e-t)+t}function q(t,e){let o=document.createElement("div");o.className=e,t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),o.appendChild(t)}var bt=(t=document)=>{t.querySelectorAll("table").forEach(e=>{let o=document.createElement("div");o.className="table-container",q(e,"table-container")})};import B from"dayjs";function Et(t,e="YYYY-MM-DD"){return B(t).format(e)}function y(t,e=!0){return t.sort((o,n)=>{let s=+new Date(o.date||""),r=+new Date(n.date||"");return e?r-s:s-r})}var Ut=t=>{let{locale:e}=I();return p(()=>{let o=e.value==="zh-CN"?"zh":e.value;return t.value[`title_${o}`]||t.value.title})};function h(t={}){let e=b();return p(()=>{let o=e.getRoutes().filter(r=>r.path.startsWith("/posts")&&r.meta.frontmatter&&r.meta.frontmatter.date).filter(r=>!r.path.endsWith(".html")).filter(r=>!t.type||r.meta.frontmatter.type===t.type).map(r=>Object.assign({path:r.path,excerpt:r.meta.excerpt},r.meta.frontmatter)),n=y(o.filter(r=>r.top)).sort((r,l)=>l.top-r.top),s=y(o.filter(r=>!r.top));return n.concat(s)})}function qt(){let t=b();return p(()=>t.getRoutes().map(o=>Object.assign({path:o.path,excerpt:o.meta.excerpt},o.meta.frontmatter)))}function Bt(t){let e=z(),o=p(()=>t||e.path),n=h(),s=p(()=>{let i=-1;return n.value.find((a,c)=>a.path===o.value?(i=c,!0):!1),i}),r=p(()=>s.value-1>=0?n.value[s.value-1]:null),l=p(()=>s.value+1<n.value.length?n.value[s.value+1]:null);return[r,l]}function zt(t){if(!t)return{color:"",icon:"",styles:{}};let e=P();t in e.value.types||(t="link");let o=e.value.types[t].color,n=e.value.types[t].icon,s=p(()=>({"--card-c-primary":t&&o}));return{color:o,icon:n,styles:s}}var Yt=t=>t.children;function $t(t,e=[]){var s;e.length||(e=N(h()));let o={total:e.length,children:new Map([["Uncategorized",{total:0,posts:[]}]])},n=o.children.get("Uncategorized");if(e.forEach(r=>{if(r.categories)if(Array.isArray(r.categories)){let l=r.categories.length,i=o;r.categories.forEach((a,c)=>{var m,d,f;if(c===l-1)if(i.children.has(a)){let u=i.children.get(a);u.posts&&(u.total+=1,u.posts.push(r))}else(m=i.children)==null||m.set(a,{total:1,posts:[r]});else if((d=i.children)!=null&&d.has(a)){let u=i.children.get(a);u.total+=1,i=u}else{let u={total:1,children:new Map};(f=i.children)==null||f.set(a,u),i=u}})}else{let l=r.categories;if(o.children.has(l)){let i=o.children.get(l);i.total+=1,i.posts.push(r)}else o.children.set(l,{total:1,posts:[r]})}else n.total+=1,n.posts.push(r)}),n.total===0&&((s=o.children)==null||s.delete("Uncategorized")),t){let r=o.children.get(t);return r?{total:r==null?void 0:r.total,children:new Map([[t,r]])}:(console.warn(`Do not have category: ${t}`),o)}else return o}import{TinyColor as j}from"@ctrl/tinycolor";function Jt(t={primary:"#0078E7"}){let e=W(),o=new j("#999999"),n=new j(t.primary);return{tags:e,getTagStyle:r=>{let l=Array.from(e).map(([d,f])=>f.count),i=Math.max(...l),a=Math.min(...l),c=i-a,m=(r-a)/c;return{"--yun-tag-color":o.mix(n,m*100).toString(),fontSize:`${m*36+12}px`}}}}function W(){let t=h(),e=new Map;return t.value.forEach(o=>{if(o.tags){let n;typeof o.tags=="string"?n=[o.tags]:n=o.tags,n.forEach(s=>{if(e.has(s)){let r=e.get(s);e.set(s,v(x({},r),{count:r.count+1}))}else e.set(s,{count:1})})}}),e}import{useRoute as L}from"vue-router";import{computed as E}from"vue";import{isClient as Y}from"@vueuse/core";function ee(){let t=L();return E(()=>t.meta.frontmatter)}function oe(){let t=g(),e=L();return E(()=>((t.value.url.endsWith("/")?t.value.url.slice(0,-1):t.value.url)||Y&&window.location.origin)+e.path)}import{useHead as $}from"@vueuse/head";function se(){$({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/katex@latest/dist/katex.min.css"}]})}import{useElementBounding as F,useIntersectionObserver as K}from"@vueuse/core";import{ref as _}from"vue";function me(t){let e=_(!1),{top:o}=F(t);return K(t,([{isIntersecting:s}])=>{e.value=s}),{show:()=>{e.value||window.scrollTo(0,o.value)}}}import{useDark as J,useToggle as G}from"@vueuse/core";var Q=J(),de=G(Q);import{computed as X}from"vue";import{useRoute as Z}from"vue-router";function xe(t){let e=Z();return X(()=>e.meta.layout===t)}import{useScriptTag as M}from"@vueuse/core";import{useHead as tt}from"@vueuse/head";function Te(){tt({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"}]}),M("https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js",()=>{M("https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js")})}import{isClient as et,useWindowScroll as ot}from"@vueuse/core";import{computed as A,ref as k}from"vue";function Le(t={offset:100}){if(!et)return{percentage:k(0),show:k(!1)};let{y:e}=ot(),o=A(()=>e.value/(document.body.scrollHeight-window.innerHeight)),n=A(()=>e.value>t.offset);return{percentage:o,show:n}}import{useHead as rt}from"@vueuse/head";function Ae(){rt({script:[{src:"https://static.codepen.io/assets/embed/ei.js",async:!0}]})}import{onMounted as nt,onUnmounted as st}from"vue";function Ve(t,e){let o=at(n,200);function n(){let i=[].slice.call(document.querySelectorAll(".va-toc a.toc-link-item")),a=[].slice.call(document.querySelectorAll("main .header-anchor")).filter(c=>i.some(m=>m.hash===c.hash));for(let c=0;c<a.length;c++){let m=a[c],d=a[c+1],[f,u]=it(c,m,d);if(f){history.replaceState(null,document.title,u||" "),r(u);return}}}let s=null;function r(i){l(s);let a=s=i==null?null:t.value.querySelector(`.va-toc a[href="${i}"]`);a?(a.classList.add("active"),e.value.style.opacity="1",e.value.style.top=`${a.offsetTop+2}px`):(e.value.style.opacity="0",e.value.style.top="54px")}function l(i){i&&i.classList.remove("active")}nt(()=>{requestAnimationFrame(n),window.addEventListener("scroll",o)}),st(()=>{window.removeEventListener("scroll",o)})}function H(t){return t.parentElement.offsetTop-50}function it(t,e,o){let n=window.scrollY;return t===0&&n===0?[!0,null]:n<H(e)?[!1,null]:!o||n<H(o)?[!0,decodeURIComponent(e.hash)]:[!1,null]}function at(t,e){let o,n=!1;return()=>{o&&clearTimeout(o),n?o=setTimeout(t,e):(t(),n=!0,setTimeout(()=>{n=!1},e))}}import{isClient as lt,useScriptTag as ct}from"@vueuse/core";import{useI18n as ut}from"vue-i18n";import{useRoute as mt}from"vue-router";function Ie(t={}){let e=mt(),{locale:o}=ut();function n(s={}){if(!lt)return;let r={el:".comment #tcomment",lang:o.value,path:e.path},l=Object.assign(r,s);return window.twikoo.init(l)}ct("//cdn.jsdelivr.net/npm/twikoo@1.5.1/dist/twikoo.all.min.js",()=>{n(t)})}import{isClient as pt,useScriptTag as ft}from"@vueuse/core";import{useHead as dt}from"@vueuse/head";import{onUnmounted as ht,watch as R}from"vue";import{useI18n as gt}from"vue-i18n";import{useRoute as yt}from"vue-router";function _e(t={}){dt({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.css"}]});let e=yt(),{locale:o}=gt(),n;function s(r={}){if(!pt)return;let l={el:".comment #waline",lang:o.value,dark:"html.dark",emoji:["https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/qq","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/weibo"],path:e.path},i=Object.assign(l,r);return window.Waline.init(i)}return ft("//cdn.jsdelivr.net/npm/@waline/client/dist/waline.js",()=>{n=s(t)}),R(()=>e.path,r=>{!n||n.update({path:r})}),R(o,r=>{!n||n.update({lang:r})}),ht(()=>{!n||n.destroy()}),n}export{xt as defaultValaxyConfig,Et as formatDate,Ct as initConfig,Q as isDark,Yt as isParentCategory,Pt as random,y as sortByDate,de as toggleDark,Ve as useActiveSidebarLinks,Te as useAplayer,Le as useBackToTop,$t as useCategory,Ae as useCodePen,g as useConfig,ee as useFrontmatter,oe as useFullUrl,me as useInvisibleElement,se as useKatex,xe as useLayout,qt as usePageList,h as usePostList,zt as usePostProperty,Ut as usePostTitle,Bt as usePrevNext,W as useTag,Jt as useTags,P as useThemeConfig,Ie as useTwikoo,_e as useWaline,T as valaxyConfigRef,U as valaxyConfigSymbol,q as wrap,bt as wrapTable};
1
+ import{a as w,b}from"./chunk-EAN2KU6W.mjs";import B from"@valaxyjs/config";import q from"@valaxyjs/context";import{computed as x,inject as z,readonly as I,shallowRef as P}from"vue";function h(t){let e=JSON.parse(t);return import.meta.env.DEV?I(e):e}var N=Symbol("valaxy:config"),j=P(h(B)),A=P(h(q));import.meta.hot&&(import.meta.hot.accept("/@valaxyjs/config",t=>{j.value=h(t.default)}),import.meta.hot.accept("/@valaxyjs/context",t=>{A.value=h(t.default)}));function Et(){return x(()=>j.value)}function Mt(){return x(()=>A.value)}function v(){let t=z(N);if(!t)throw new Error("[Valaxy] config not properly injected in app");return t}function y(){let t=v();return x(()=>t.value.themeConfig)}import{unref as J}from"vue";import{computed as f}from"vue";import{useRoute as K,useRouter as L}from"vue-router";import{useI18n as _}from"vue-i18n";function St(t,e){return Math.random()*(e-t)+t}function $(t,e){let o=document.createElement("div");o.className=e,t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),o.appendChild(t)}var Dt=(t=document)=>{t.querySelectorAll("table").forEach(e=>{let o=document.createElement("div");o.className="table-container",$(e,"table-container")})};function Ht(t,e){let o,n=!1;return()=>{o&&clearTimeout(o),n?o=setTimeout(t,e):(t(),n=!0,setTimeout(()=>{n=!1},e))}}import F from"dayjs";function Ot(t,e="YYYY-MM-DD"){return F(t).format(e)}function C(t,e=!0){return t.sort((o,n)=>{let i=+new Date(o.date||""),r=+new Date(n.date||"");return e?r-i:i-r})}var Ft=t=>{let{locale:e}=_();return f(()=>{let o=e.value==="zh-CN"?"zh":e.value;return t.value[`title_${o}`]||t.value.title})};function g(t={}){let e=L();return f(()=>{let o=e.getRoutes().filter(r=>r.path.startsWith("/posts")&&r.meta.frontmatter&&r.meta.frontmatter.date).filter(r=>!r.path.endsWith(".html")).filter(r=>!t.type||r.meta.frontmatter.type===t.type).map(r=>Object.assign({path:r.path,excerpt:r.meta.excerpt},r.meta.frontmatter)),n=C(o.filter(r=>r.top)).sort((r,a)=>a.top-r.top),i=C(o.filter(r=>!r.top));return n.concat(i)})}function Kt(){let t=L();return f(()=>t.getRoutes().map(o=>Object.assign({path:o.path,excerpt:o.meta.excerpt},o.meta.frontmatter)))}function _t(t){let e=K(),o=f(()=>t||e.path),n=g(),i=f(()=>{let s=-1;return n.value.find((l,u)=>l.path===o.value?(s=u,!0):!1),s}),r=f(()=>i.value-1>=0?n.value[i.value-1]:null),a=f(()=>i.value+1<n.value.length?n.value[i.value+1]:null);return[r,a]}function Jt(t){if(!t)return{color:"",icon:"",styles:{}};let e=y();t in e.value.types||(t="link");let o=e.value.types[t].color,n=e.value.types[t].icon,i=f(()=>({"--card-c-primary":t&&o}));return{color:o,icon:n,styles:i}}var Zt=t=>t.children;function te(t,e=[]){var i;e.length||(e=J(g()));let o={total:e.length,children:new Map([["Uncategorized",{total:0,posts:[]}]])},n=o.children.get("Uncategorized");if(e.forEach(r=>{if(r.categories)if(Array.isArray(r.categories)){let a=r.categories.length,s=o;r.categories.forEach((l,u)=>{var m,d,p;if(u===a-1)if(s.children.has(l)){let c=s.children.get(l);c.posts&&(c.total+=1,c.posts.push(r))}else(m=s.children)==null||m.set(l,{total:1,posts:[r]});else if((d=s.children)!=null&&d.has(l)){let c=s.children.get(l);c.total+=1,s=c}else{let c={total:1,children:new Map};(p=s.children)==null||p.set(l,c),s=c}})}else{let a=r.categories;if(o.children.has(a)){let s=o.children.get(a);s.total+=1,s.posts.push(r)}else o.children.set(a,{total:1,posts:[r]})}else n.total+=1,n.posts.push(r)}),n.total===0&&((i=o.children)==null||i.delete("Uncategorized")),t){let r=o.children.get(t);return r?{total:r==null?void 0:r.total,children:new Map([[t,r]])}:(console.warn(`Do not have category: ${t}`),o)}else return o}import{TinyColor as E}from"@ctrl/tinycolor";function ne(t={primary:"#0078E7"}){let e=G(),o=new E("#999999"),n=new E(t.primary);return{tags:e,getTagStyle:r=>{let a=Array.from(e).map(([d,p])=>p.count),s=Math.max(...a),l=Math.min(...a),u=s-l,m=(r-l)/u;return{"--yun-tag-color":o.mix(n,m*100).toString(),fontSize:`${m*36+12}px`}}}}function G(){let t=g(),e=new Map;return t.value.forEach(o=>{if(o.tags){let n;typeof o.tags=="string"?n=[o.tags]:n=o.tags,n.forEach(i=>{if(e.has(i)){let r=e.get(i);e.set(i,b(w({},r),{count:r.count+1}))}else e.set(i,{count:1})})}}),e}import{useRoute as M}from"vue-router";import{computed as R}from"vue";import{isClient as Q}from"@vueuse/core";function S(){let t=M();return R(()=>t.meta.frontmatter)}function ce(){let t=v(),e=M();return R(()=>((t.value.url.endsWith("/")?t.value.url.slice(0,-1):t.value.url)||Q&&window.location.origin)+e.path)}import{useElementBounding as X,useIntersectionObserver as Z}from"@vueuse/core";import{ref as tt}from"vue";function de(t){let e=tt(!1),{top:o}=X(t);return Z(t,([{isIntersecting:i}])=>{e.value=i}),{show:()=>{e.value||window.scrollTo(0,o.value)}}}import{useDark as et,useToggle as ot}from"@vueuse/core";var rt=et(),ye=ot(rt);import{computed as nt}from"vue";import{useRoute as it}from"vue-router";function Te(t){let e=it();return nt(()=>e.meta.layout===t)}import{useScriptTag as D}from"@vueuse/core";import{useHead as st}from"@vueuse/head";function je(){st({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css"}]}),D("https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js",()=>{D("https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js")})}import{isClient as at,useWindowScroll as lt}from"@vueuse/core";import{computed as H,ref as k}from"vue";function Me(t={offset:100}){if(!at)return{percentage:k(0),show:k(!1)};let{y:e}=lt(),o=H(()=>e.value/(document.body.scrollHeight-window.innerHeight)),n=H(()=>e.value>t.offset);return{percentage:o,show:n}}import{useHead as ut}from"@vueuse/head";function De(){ut({script:[{src:"https://static.codepen.io/assets/embed/ei.js",async:!0}]})}import{computed as T,onMounted as ct,onUnmounted as mt,ref as ft}from"vue";import{useRoute as W}from"vue-router";import{ensurePrefix as V}from"@antfu/utils";function O(t,e){if(Array.isArray(t))return t;e=V("/",e);for(let o in t)if(e.startsWith(V("/",o)))return t[o];return[]}function $e(){let t=W(),e=S(),o=y(),n=ft(!1),i=T(()=>{let u=o.value.sidebar,m=t.path;return u?O(u,m):[]}),r=T(()=>e.value.sidebar!==!1);function a(){n.value=!0}function s(){n.value=!1}function l(){n.value?s():a()}return{isOpen:n,sidebar:i,hasSidebar:r,open:a,close:s,toggle:l}}function Fe(t,e){let o=dt(n,200);function n(){let s=[].slice.call(document.querySelectorAll(".va-toc a.toc-link-item")),l=[].slice.call(document.querySelectorAll("main .header-anchor")).filter(u=>s.some(m=>m.hash===u.hash));for(let u=0;u<l.length;u++){let m=l[u],d=l[u+1],[p,c]=pt(u,m,d);if(p){history.replaceState(null,document.title,c||" "),r(c);return}}}let i=null;function r(s){a(i);let l=i=s==null?null:t.value.querySelector(`.va-toc a[href="${s}"]`);e.value&&(l?(l.classList.add("active"),e.value.style.opacity="1",e.value.style.top=`${l.offsetTop+2}px`):(e.value.style.opacity="0",e.value.style.top="54px"))}function a(s){s&&s.classList.remove("active")}ct(()=>{requestAnimationFrame(n),window.addEventListener("scroll",o)}),mt(()=>{window.removeEventListener("scroll",o)})}function U(t){return t.parentElement.offsetTop-50}function pt(t,e,o){let n=window.scrollY;return t===0&&n===0?[!0,null]:n<U(e)?[!1,null]:!o||n<U(o)?[!0,decodeURIComponent(e.hash)]:[!1,null]}function dt(t,e){let o,n=!1;return()=>{o&&clearTimeout(o),n?o=setTimeout(t,e):(t(),n=!0,setTimeout(()=>{n=!1},e))}}function Ke(){let t=W();return{hasOutline:T(()=>t.meta.headers.length>0)}}import{isClient as gt,useScriptTag as ht}from"@vueuse/core";import{useI18n as yt}from"vue-i18n";import{useRoute as xt}from"vue-router";function Xe(t={}){let e=xt(),{locale:o}=yt();function n(i={}){if(!gt)return;let r={el:".comment #tcomment",lang:o.value,path:e.path},a=Object.assign(r,i);return window.twikoo.init(a)}ht("//cdn.jsdelivr.net/npm/twikoo@1.5.1/dist/twikoo.all.min.js",()=>{n(t)})}import{isClient as vt,useScriptTag as Ct}from"@vueuse/core";import{useHead as Tt}from"@vueuse/head";import{onUnmounted as wt,watch as Y}from"vue";import{useI18n as bt}from"vue-i18n";import{useRoute as Pt}from"vue-router";function io(t={}){Tt({link:[{rel:"stylesheet",href:"https://cdn.jsdelivr.net/npm/@waline/client/dist/waline.css"}]});let e=Pt(),{locale:o}=bt(),n;function i(r={}){if(!vt)return;let a={el:".comment #waline",lang:o.value,dark:"html.dark",emoji:["https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/bilibili","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/qq","https://cdn.jsdelivr.net/gh/walinejs/emojis@1.0.0/weibo"],path:e.path},s=Object.assign(a,r);return window.Waline.init(s)}return Ct("//cdn.jsdelivr.net/npm/@waline/client/dist/waline.js",()=>{n=i(t)}),Y(()=>e.path,r=>{!n||n.update({path:r})}),Y(o,r=>{!n||n.update({lang:r})}),wt(()=>{!n||n.destroy()}),n}function Mo(t){return t}function Ro(t){return t}export{Mo as defineConfig,Ro as defineConfigWithTheme,Ot as formatDate,Et as initConfig,Mt as initContext,rt as isDark,Zt as isParentCategory,St as random,C as sortByDate,Ht as throttleAndDebounce,ye as toggleDark,Fe as useActiveSidebarLinks,je as useAplayer,Me as useBackToTop,te as useCategory,De as useCodePen,v as useConfig,S as useFrontmatter,ce as useFullUrl,de as useInvisibleElement,Te as useLayout,Ke as useOutline,Kt as usePageList,g as usePostList,Jt as usePostProperty,Ft as usePostTitle,_t as usePrevNext,$e as useSidebar,G as useTag,ne as useTags,y as useThemeConfig,Xe as useTwikoo,io as useWaline,j as valaxyConfigRef,N as valaxyConfigSymbol,A as valaxyContextRef,$ as wrap,Dt as wrapTable};