function e(e,t,n=`datetime`){if(t===`localized`){let t=navigator.languages,r=n===`time`?void 0:`medium`,i=n===`date`?void 0:`medium`;try{return new Intl.DateTimeFormat(t,{dateStyle:r,timeStyle:i}).format(e.toDate())}catch(t){if(t instanceof RangeError)return new Intl.DateTimeFormat(void 0,{dateStyle:r,timeStyle:i}).format(e.toDate());throw t}}return t===`distance`?e.fromNow():t===`calendar`?e.calendar():t===`iso8601`?n===`date`?e.format(`YYYY-MM-DD`):n===`time`?e.format(`HH:mm:ss.SSS[Z]`):e.toISOString():e.format(t)}export{e as t};