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