function I(n,r){return D(n.game_versions.slice(),r)}function D(n,r){var R;const t=n.slice(),a=r.slice(),c=a.filter(e=>e.version_type==="snapshot"),l=a.filter(e=>e.version_type==="release"),u=a.filter(e=>e.version_type!=="snapshot"&&e.version_type!=="release");{const e=a.reduce((s,p,v)=>(s[p.version]=v,s),{});t.sort((s,p)=>e[s]-e[p])}const o=t.filter(e=>l.some(s=>s.version===e)),i=(R=l.find(e=>e.version===o[0]))==null?void 0:R.date,g=i?Date.parse(i):0,h=t.find(e=>c.some(s=>s.version===e&&(!g||ge.version),!1),V=y(o,!0).map(({major:e,minor:s})=>{if(s.length===1)return d(e,s[0]);const p=$.find(v=>v.major===e);return p!=null&&p.minor.every((v,b)=>v===s[b])?`${e}.x`:`${d(e,s[0])}–${d(e,s[s.length-1])}`});let f=[...m(t.filter(e=>u.some(s=>s.version===e)),u)];return V.length===0?f=[...m(t.filter(s=>c.some(p=>p.version===s)),c),...f]:f=[...V,...f],h&&!f.includes(h)&&(f=[h,...f]),f}const _=/^([0-9]+.[0-9]+)(.[0-9]+)?$/;function y(n,r=!1){return n.slice().reverse().reduce((t,a)=>{const c=a.match(_);if(c){const l=c[1],u=c[2],o=u?parseInt(u.replace(".","")):0,i=t.find(g=>g.major===l&&(!r||g.minor.at(-1)===o-1));return i?(i.minor.push(o),t):[...t,{major:l,minor:[o]}]}return t},[]).reverse()}function m(n,r){if(!n||n.length===0)return[];const t=new Map;r.forEach((o,i)=>{t.set(o.version,i)});const a=n.slice().sort((o,i)=>t.get(o)-t.get(i)),c=[];let l=a[0],u=a[0];for(let o=1;o