1import{e as m,k as S}from"./CxzYtgGg.js";import{s as y,a as T,m as h,f as c}from"./CMD7SeaB.js";import{a as C,l as g,r as N,s as U}from"./BHEXRSu5.js";function v(e,t){return C(e,t*1e3)}function M(e,t){const n=y(e),a=y(t);return+n==+a}function D(e,t){const a=H(e);let r;if(a.date){const o=L(a.date,2);r=Y(o.restDateString,o.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);const s=r.getTime();let i=0,u;if(a.time&&(i=O(a.time),isNaN(i)))return new Date(NaN);if(a.timezone){if(u=b(a.timezone),isNaN(u))return new Date(NaN)}else{const o=new Date(s+i),d=new Date(0);return d.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),d.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),d}return new Date(s+i+u)}const f={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},F=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,I=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,x=/^([+-])(\d{2})(?::?(\d{2}))?$/;function H(e){const t={},n=e.split(f.dateTimeDelimiter);let a;if(n.length>2)return t;if(/:/.test(n[0])?a=n[0]:(t.date=n[0],a=n[1],f.timeZoneDelimiter.test(t.date)&&(t.date=e.split(f.timeZoneDelimiter)[0],a=e.substr(t.date.length,e.length))),a){const r=f.timezone.exec(a);r?(t.time=a.replace(r[1],""),t.timezone=r[1]):t.time=a}return t}function L(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),a=e.match(n);if(!a)return{year:NaN,restDateString:""};const r=a[1]?parseInt(a[1]):null,s=a[2]?parseInt(a[2]):null;return{year:s===null?r:s*100,restDateString:e.slice((a[1]||a[2]).length)}}function Y(e,t){if(t===null)return new Date(NaN);const n=e.match(F);if(!n)return new Date(NaN);const a=!!n[4],r=l(n[1]),s=l(n[2])-1,i=l(n[3]),u=l(n[4]),o=l(n[5])-1;if(a)return W(t,u,o)?k(t,u,o):new Date(NaN);{const d=new Date(0);return!R(t,s,i)||!Z(t,r)?new Date(NaN):(d.setUTCFullYear(t,s,Math.max(r,i)),d)}}function l(e){return e?parseInt(e):1}function O(e){const t=e.match(I);if(!t)return NaN;const n=p(t[1]),a=p(t[2]),r=p(t[3]);return P(n,a,r)?n*T+a*h+r*1e3:NaN}function p(e){return e&&parseFloat(e.replace(",","."))||0}function b(e){if(e==="Z")return 0;const t=e.match(x);if(!t)return 0;const n=t[1]==="+"?-1:1,a=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return _(a,r)?n*(a*T+r*h):NaN}function k(e,t,n){const a=new Date(0);a.setUTCFullYear(e,0,4);const r=a.getUTCDay()||7,s=(t-1)*7+n+1-r;return a.setUTCDate(a.getUTCDate()+s),a}const z=[31,null,31,30,31,30,31,31,30,31,30,31];function w(e){return e%400===0||e%4===0&&e%100!==0}function R(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(z[t]||(w(e)?29:28))}function Z(e,t){return t>=1&&t<=(w(e)?366:365)}function W(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function P(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function _(e,t){return t>=0&&t<=59}const j=e=>{const[t,...n]=e;return`${t.toUpperCase()}${n.join("")}`},K=e=>({ÑнваÑÑ:"ÑнваÑÑ",ÑевÑалÑ:"ÑевÑалÑ",маÑÑ:"маÑÑа",апÑелÑ:"апÑелÑ",май:"маÑ",иÑнÑ:"иÑнÑ",иÑлÑ:"иÑлÑ",авгÑÑÑ:"авгÑÑÑа",ÑенÑÑбÑÑ:"ÑенÑÑбÑÑ",окÑÑбÑÑ:"окÑÑбÑÑ",ноÑбÑÑ:"ноÑбÑÑ",декабÑÑ:"декабÑÑ"})[e?.toLowerCase()]||e,E=e=>M(e,U(new Date,1));function B(e){const t=m(),n=D(e),a=Math.max(0,Math.round((new Date().getTime()-n.getTime())/6e4));if(a<1)return t?"tikko":"ÑолÑко ÑÑо";if(a<60)return t?`pirms ${a} min`:`${a} мин назад`;const r=Math.round(a/60);if(r<24)return t?`pirms ${r} h`:`${r} Ñ Ð½Ð°Ð·Ð°Ð´`;const s=Math.round(r/24);return t?`pirms ${s} d`:`${s} дн назад`}function $(e,t="dd.MM.yyyy"){const n=D(e.dateString),r=M(n,new Date),s=m();if(E(n)||r){const i=c(n,"HH:mm"),{t:u}=S();return`${u(r?"titles.today":"titles.yesterday")} ${i}`}return c(n,t,{locale:s?g:N})}const G=()=>{const e=new Date,t={locale:m()?g:N},n=j(c(e,"cccc,",t)),a=c(e,m()?"d.":"d");let r=c(e,"LLLL",t);return m()||(r=K(r)),`${n} ${a} ${r}`},Q=e=>{const t=$({dateString:e});if(t)return t;const n=D(e);return c(n,"yyyy-MM-dd HH:mm")},X=e=>$({dateString:e.published_at},"PPP, HH:mm")??"",tt=()=>c(new Date,"yyyy-MM-dd"),et=e=>{const t=e.getDate().toString().padStart(2,"0"),n=(e.getMonth()+1).toString().padStart(2,"0"),a=e.getFullYear().toString();return`${t}-${n}-${a}`},nt=e=>{const t=D(e),n={locale:m()?g:N};return c(t,"HH:mm, dd. MMMM, yyyy",n)},at=()=>c(new Date,"d"),rt=()=>c(new Date,"M"),J=e=>c(e,"mm:ss"),st=e=>{const[t,n,a]=e.split(":").map(Number),r=t*3600+n*60+a,s=y(new Date(0)),i=v(s,r);return J(i)};export{X as a,tt as b,nt as c,$ as d,rt as e,at as f,st as g,Q as l,B as r,et as t,G as v};
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.