import{I as h,dC as d}from"./B2UyoCas.js";import{e as $,f as w,h as y,i as M}from"./DRe2XjRQ.js";const j=()=>{const{t,locale:A}=h();return{pastTime:(i,o=!0)=>{const e=new Date(i),m=new Date().getTime()-e.getTime(),u=Math.floor(m/1e3);if(u<60){const a=`${t("timeAgo.second",{count:u})}`;return o?t("timeAgo.ago",[a]):t("timeAgo.in",[a])}const c=Math.floor(m/(1e3*60));if(c<60){const a=`${t("timeAgo.minute",{count:c})}`;return o?t("timeAgo.ago",{0:a}):t("timeAgo.in",{0:a})}const s=Math.floor(m/(1e3*60*60));if(s<24)return`${t("timeAgo.hour",{count:s})}`;const r=Math.floor(m/(1e3*60*60*24));if(r<7)return`${t("timeAgo.day",{count:r})}`;const g=Math.floor(r/7);if(g<4)return`${t("timeAgo.week",{count:g})}`;const f=Math.floor(r/30.436875);if(f<12)return`${t("timeAgo.month",{count:f})}`;const l=Math.floor(r/365.25);return`${t("timeAgo.year",{count:l})}`},generateDate:i=>{const o={de:"de-DE",en:"en-US",ja:"ja-JP",fr:"fr-FR",it:"it-IT",es:"es-ES",ru:"ru-RU"};return new Date(i).toLocaleString(o[A.value])},formatLocaleTimeAgo:i=>{const o={justNow:t("timeAgo.justNow"),past:e=>e.match(/\d/)?t("timeAgo.ago",[e]):e,future:e=>e.match(/\d/)?t("timeAgo.in",[e]):e,month:(e,n)=>e===1?t(n?"timeAgo.lastMonth":"timeAgo.nextMonth"):`${t("timeAgo.month",{count:e})}`,year:(e,n)=>e===1?t(n?"timeAgo.lastYear":"timeAgo.nextYear"):`${t("timeAgo.year",{count:e})}`,day:(e,n)=>e===1?t(n?"timeAgo.yesterday":"timeAgo.tomorrow"):`${t("timeAgo.day",{count:e})}`,week:(e,n)=>e===1?t(n?"timeAgo.lastWeek":"timeAgo.nextWeek"):`${t("timeAgo.week",{count:e})}`,hour:(e,n)=>`${t("timeAgo.hour",{count:e})}`,minute:(e,n)=>`${t("timeAgo.minute",{count:e})}`,second:(e,n)=>`${t("timeAgo.second",{count:e})}`,invalid:""};return d(i,{fullDateFormatter:e=>e.toLocaleString(),messages:o})},calculateDuration:(i,o)=>{const e=$(o,i);return e<121?t("timeAgo.minute",{count:e}):e<4e3?t("timeAgo.hour",{count:w(o,i)}):e<9e4?t("timeAgo.day",{count:y(o,i)}):t("timeAgo.week",{count:M(o,i)})}}};export{j as u};
