import{cu as p,cJ as h,v as w,W as H}from"./index-6Jqoo2rk.js";var a=(t=>(t[t.Seconds=0]="Seconds",t[t.Minutes=1]="Minutes",t[t.Hours=2]="Hours",t[t.Days=3]="Days",t[t.Weeks=4]="Weeks",t[t.Months=5]="Months",t[t.Years=6]="Years",t))(a||{});function l(t,e=2){t||(t=1);const n=[],s=[{m:1,t:0},{m:60,t:1},{m:60,t:2},{m:24,t:3},{m:7,t:4},{m:365/12/7,t:5},{m:12,t:6}];let r=1;s.forEach((c,f)=>{if(r=Math.round(r*c.m),t<r)return;let i=t/r;if(f!==s.length-1){const S=s[f===s.length-1?f:f+1].m;i%=S}n.push({duration:i|0,type:c.t})});const u=n.slice(-e).reverse();for(let c=u.length-1;c>=0;--c)u[c].duration===0&&u.splice(c,1);return u}function d(t,e=!1){const n=parseInt(t+"",10);let s=Math.floor(n/3600),o=Math.floor((n-s*3600)/60),r=n-s*3600-o*60;return s&&s<10&&e&&(s="0"+s),o<10&&(s||e)&&(o="0"+o),r<10&&(r="0"+r),(s?s+":":"")+o+":"+r}const M={[a.Seconds]:"Seconds",[a.Minutes]:"Minutes",[a.Hours]:"Hours",[a.Days]:"Days",[a.Weeks]:"Weeks",[a.Months]:"Months",[a.Years]:"Years"};function m(t,e){if(e){const o=t.map(r=>p.format(M[r.type],!0,[r.duration]));return h(o,!1,e)}const n=t.map(o=>w(M[o.type],[o.duration])),s=document.createElement("span");return s.append(...h(n,!1)),s}function g(t,e){return m(l(t,2),e)}function E(t){const e=l(t,3);return e[0].type<=a.Hours?d(t,!0):(e.splice(1,1/0),m(e))}function W(t){const e=l(t,3);return e[0].type===a.Seconds?m(e):d(t,!0)}function Y(t){return m(l(t,1))}function v(t,e=!0){const n=document.createElement("a");return n.href="#",n.onclick=s=>{e&&H(s),t(s)},n}export{a as D,m as a,v as b,E as c,W as d,Y as e,l as f,d as t,g as w};
//# sourceMappingURL=anchorCallback-DsA1XczG.js.map
