1import{t as u,c as y,m as X,a as D}from"./toDate-CTowH2ac.js";import{n as S,g as O,e as _,a as I}from"./fr-BlJCihh7.js";function M(n,s){const e=+u(n)-+u(s);return e<0?-1:e>0?1:e}function T(n){return y(n,Date.now())}function Y(n,s,e){const[o,t]=S(e?.in,n,s),c=o.getFullYear()-t.getFullYear(),i=o.getMonth()-t.getMonth();return c*12+i}function w(n){return s=>{const o=(n?Math[n]:Math.trunc)(s);return o===0?0:o}}function b(n,s){return+u(n)-+u(s)}function F(n,s){const e=u(n,s?.in);return e.setHours(23,59,59,999),e}function N(n,s){const e=u(n,s?.in),o=e.getMonth();return e.setFullYear(e.getFullYear(),o+1,0),e.setHours(23,59,59,999),e}function H(n,s){const e=u(n,s?.in);return+F(e,s)==+N(e,s)}function p(n,s,e){const[o,t,c]=S(e?.in,n,n,s),i=M(t,c),r=Math.abs(Y(t,c));if(r<1)return 0;t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-i*r);let l=M(t,c)===-i;H(o)&&r===1&&M(o,c)===1&&(l=!1);const m=i*(r-+l);return m===0?0:m}function v(n,s,e){const o=b(n,s)/1e3;return w(e?.roundingMethod)(o)}function z(n,s,e){const o=O(),t=e?.locale??o.locale??_,c=2520,i=M(n,s);if(isNaN(i))throw new RangeError("Invalid time value");const r=Object.assign({},e,{addSuffix:e?.addSuffix,comparison:i}),[l,m]=S(e?.in,...i>0?[s,n]:[n,s]),d=v(m,l),x=(I(m)-I(l))/1e3,a=Math.round((d-x)/60);let h;if(a<2)return e?.includeSeconds?d<5?t.formatDistance("lessThanXSeconds",5,r):d<10?t.formatDistance("lessThanXSeconds",10,r):d<20?t.formatDistance("lessThanXSeconds",20,r):d<40?t.formatDistance("halfAMinute",0,r):d<60?t.formatDistance("lessThanXMinutes",1,r):t.formatDistance("xMinutes",1,r):a===0?t.formatDistance("lessThanXMinutes",1,r):t.formatDistance("xMinutes",a,r);if(a<45)return t.formatDistance("xMinutes",a,r);if(a<90)return t.formatDistance("aboutXHours",1,r);if(a<X){const f=Math.round(a/60);return t.formatDistance("aboutXHours",f,r)}else{if(a<c)return t.formatDistance("xDays",1,r);if(a<D){const f=Math.round(a/X);return t.formatDistance("xDays",f,r)}else if(a<D*2)return h=Math.round(a/D),t.formatDistance("aboutXMonths",h,r)}if(h=p(m,l),h<12){const f=Math.round(a/D);return t.formatDistance("xMonths",f,r)}else{const f=h%12,g=Math.trunc(h/12);return f<3?t.formatDistance("aboutXYears",g,r):f<9?t.formatDistance("overXYears",g,r):t.formatDistance("almostXYears",g+1,r)}}function R(n,s){return z(n,T(n),s)}export{R as f};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.