(function(e,o){typeof exports=="object"&&typeof module<"u"?module.exports=o(require("vue")):typeof define=="function"&&define.amd?define(["vue"],o):(e=typeof globalThis<"u"?globalThis:e||self,e.vitepressPluginLifeProgress=o(e.vue))})(this,function(e){"use strict";var o=document.createElement("style");o.innerHTML=`.life-progress{width:100%;position:fixed;top:0;left:0;z-index:1}.life-progress ul{display:flex;width:100%}.life-progress ul li{position:relative;flex-grow:1;height:2px;list-style:none;font-size:12px;line-height:24px;background-color:var(--vp-c-text-4);color:var(--vp-c-text-2)}.life-progress ul li:not(:last-child){margin-right:2px}.life-progress ul li .filler{position:absolute;display:inline-block;height:100%;background-color:var(--vp-c-text-1)}.life-progress ul li .label-box{position:absolute;display:flex;justify-content:space-between;transition:.5s}.life-progress ul li .label-box .day{transform:translate(50%)} `,document.head.appendChild(o);const g={class:"life-progress"},h={class:"month"},y={class:"day"},E=e.defineComponent({__name:"template",props:{customEventName:null},setup(t){const s=t,l=e.ref(!1),m=(n=!0)=>l.value=n,d=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],v=()=>new Date,x=(n,a)=>new Date(n,a,0).getDate(),p=e.ref(v()),b=e.computed(()=>p.value.getFullYear()),r=e.computed(()=>p.value.getMonth()),u=e.computed(()=>p.value.getDate()),N=e.computed(()=>x(b.value,r.value)),k=e.computed(()=>d.map((n,a)=>({name:n,width:am(n.detail);return window.addEventListener(s.customEventName,f),e.onUnmounted(()=>{window.removeEventListener(s.customEventName,f)}),(n,a)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(k),(i,L)=>(e.openBlock(),e.createElementBlock("li",{key:i},[e.createElementVNode("span",{class:"filler",style:e.normalizeStyle({width:`${i.width}%`})},null,4),L===e.unref(r)?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({opacity:l.value?1:0,width:`${i.width}%`}),class:"label-box"},[e.createElementVNode("span",h,e.toDisplayString(i.name),1),e.createElementVNode("span",y,e.toDisplayString(e.unref(u)),1)],4)):e.createCommentVNode("",!0)]))),128))])]))}}),D="",c="vitepress-life-progress",w=()=>{const t=document.getElementsByClassName("VPNav")[0],s=e.createVNode(E,{customEventName:c}),l=document.createElement("div");t.appendChild(l),e.render(s,l);const d=s.component.proxy;return{mountEl:t,vm:d}},_=t=>{t.addEventListener("mouseenter",()=>window.dispatchEvent(new CustomEvent(c,{detail:!0}))),t.addEventListener("mouseleave",()=>window.dispatchEvent(new CustomEvent(c,{detail:!1})))};return()=>{typeof window>"u"||e.onMounted(()=>{const{mountEl:t}=w();_(t)})}}); //# sourceMappingURL=vitepress-plugin-life-progress.umd.cjs.map