var e=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),t=new Intl.DateTimeFormat(void 0,{timeStyle:`short`}),n=/(^|[^0-9])(1\d{12,16})([^0-9]|$)/,r=/^(\d{4}-\d{2}-\d{2})\s+(\d{1,2}:\d{2}:\d{2})(?:\.\d+)?(?:\s*([+-]\d{2}:\d{2}(?::\d{2})?|Z))?$/;function i(e){if(e==null)return null;if(typeof e==`number`)return Number.isFinite(e)?e:null;if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:null}if(typeof e!=`string`)return null;let t=e.trim();if(!t||t.toLowerCase()===`array`)return null;let n=Date.parse(t);if(Number.isFinite(n))return n;let i=t.match(r);if(i){let[,e,t,n]=i,r=`${e}T${t}${n??`Z`}`,a=Date.parse(r);if(Number.isFinite(a))return a}return null}function a(t,n=`—`){let r=i(t);return r===null?n:e.format(new Date(r))}function o(e,n=`never`){let r=i(e);return r===null?n:t.format(new Date(r))}function s(e){if(/^\d+$/.test(e)){let t=Number.parseInt(e,10);return Number.isFinite(t)?t:null}return null}function c(e){let t=e.match(n);if(!t?.[2])return null;let r=Number.parseInt(t[2],10);return Number.isFinite(r)?r:null}function l(e,t){return e!==null&&t!==null?t-e:e===null?t===null?0:1:-1}function u(e){let t=e.map((e,t)=>({action:e,index:t,updatedAt:i(e.updated_at),createdAt:i(e.created_at),numericIdHint:s(e.id),epochFromCodeHint:c(e.code)}));return t.sort((e,t)=>{let n=l(e.updatedAt,t.updatedAt);if(n!==0)return n;let r=l(e.createdAt,t.createdAt);if(r!==0)return r;let i=l(e.numericIdHint,t.numericIdHint);if(i!==0)return i;let a=l(e.epochFromCodeHint,t.epochFromCodeHint);if(a!==0)return a;let o=e.action.code.localeCompare(t.action.code);if(o!==0)return o;let s=e.action.id.localeCompare(t.action.id);return s===0?e.index-t.index:s}),t.map(({action:e})=>e)}export{a as n,u as r,o as t};