import{r as t,h as i}from"./p-52e3bb32.js";import{_ as s}from"./p-08cf2c0e.js";import{T as e}from"./p-b0e88537.js";const a=class{constructor(i){t(this,i),this.formatedDate=void 0,this.datetime=void 0,this.afDateTime=void 0,this.afVariation=e.PRIMARY,this.afLocale="default"}primaryFormat(t){return t.toLocaleString(this.afLocale,{year:"numeric",month:"2-digit",day:"2-digit"})}prettyFormat(t){return t.toLocaleString(this.afLocale,{day:"numeric",month:"long",year:"numeric"})}distanceFormat(t){const i=864e5,e=Math.floor(Date.now()-t.getTime());let a=Math.floor(e/i);return a=Math.abs(a),e>i?s.time.days_ago(a):e<i?0===a?s.today:s.time.in_days(a):void 0}formatDate(t){const i=new Date(t);switch(this.afVariation){case e.PRIMARY:this.formatedDate=this.primaryFormat(i);break;case e.PRETTY:this.formatedDate=this.prettyFormat(i);break;case e.DISTANCE:this.formatedDate=this.distanceFormat(i)}this.datetime=this.primaryFormat(i)}componentWillLoad(){this.formatDate(this.afDateTime)}render(){return i("time",{key:"996c32b9f71d80f7a2362b90d8bb153627ad4645",dateTime:this.datetime,class:"digi-typography-time"},this.formatedDate)}static get watchers(){return{afDateTime:["formatDate"]}}};export{a as digi_typography_time}