import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{Fragment as r,jsx as i,jsxs as a}from"hono/jsx/jsx-runtime";import{load as o}from"cheerio";import{renderToString as s}from"hono/jsx/dom/server";import{raw as c}from"hono/html";const l=({images:e,intro:t,description:n})=>s(a(r,{children:[e?.map(e=>e?.src?i(`figure`,{children:i(`img`,{src:e.src,alt:e.alt??void 0})}):null),t?i(`blockquote`,{children:t}):null,n?i(r,{children:c(n)}):null]})),u=async r=>{let{category:i=``}=r.req.param(),a=r.req.query(`limit`)?Number.parseInt(r.req.query(`limit`),10):12,s=`https://lrepacks.net`,c=new URL(i,s).href,{data:u}=await n(c),d=o(u),f=d(`html`).prop(`lang`),p=d(`#main article`).slice(0,a).toArray().map(e=>(e=d(e),{title:e.find(`h3.entry-title`).text(),description:l({intro:e.find(`div.entry-content`).text()}),link:e.find(`h3.entry-title a`).prop(`href`),category:e.find(`span.cat-links`).toArray().map(e=>d(e).text()),language:f}));p=await Promise.all(p.map(r=>e.tryGet(r.link,async()=>{let{data:e}=await n(r.link),i=o(e),a=JSON.parse(i(`script[type="application/ld+json"]`).first().text())[`@graph`]?.[0]??void 0;i(`div.entry-content a.highslide[href]`).each((e,t)=>{t=i(t),t.parent().replaceWith(l({images:[{src:t.prop(`href`),alt:t.prop(`title`)}]}))});let s=i(`h2.entry-title`).text(),c=r.description+l({description:i(`div.entry-content`).html()??void 0}),u=i(`meta[property="og:image"]`).prop(`content`);return r.title=s,r.description=c,r.pubDate=a?t(a.datePublished):void 0,r.author=a?.author?.name??void 0,r.content={html:c,text:i(`div.entry-content`).text()},r.image=u,r.banner=u,r.updated=a?t(a.dateModified):void 0,r.language=f,r})));let m=new URL(d(`div.logo img`).prop(`src`),s).href;return{title:d(`title`).text(),description:d(`meta[name="description"]`).prop(`content`),link:c,item:p,allowEmpty:!0,image:m,author:d(`meta[property="og:site_name"]`).prop(`content`),language:f}},d={path:`/:category?`,name:`REPACK скачать`,url:`lrepacks.net`,maintainers:[`nczitzk`],handler:u,example:`/lrepacks`,parameters:{category:`Category, Homepage by default`},description:`::: tip
  If you subscribe to [Системные программы](https://lrepacks.net/repaki-sistemnyh-programm/)，where the URL is \`https://lrepacks.net/repaki-sistemnyh-programm/\`, extract the part \`https://lrepacks.net/\` to the end, which is \`repaki-sistemnyh-programm\`, and use it as the parameter to fill in. Therefore, the route will be [\`/lrepacks/repaki-sistemnyh-programm\`](https://rsshub.app/lrepacks/repaki-sistemnyh-programm).

| Category                                                                        | ID                                                                                           |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| [Новые репаки на сегодня](https://lrepacks.net/novye-repaki-elchupacabra/)      | [novye-repaki-elchupacabra](https://rsshub.app/lrepacks/novye-repaki-elchupacabra)           |
| [Системные программы](https://lrepacks.net/repaki-sistemnyh-programm/)          | [repaki-sistemnyh-programm](https://rsshub.app/lrepacks/repaki-sistemnyh-programm)           |
| [Программы для графики](https://lrepacks.net/repaki-programm-dlya-grafiki/)     | [repaki-programm-dlya-grafiki](https://rsshub.app/lrepacks/repaki-programm-dlya-grafiki)     |
| [Программы для интернета](https://lrepacks.net/repaki-programm-dlya-interneta/) | [repaki-programm-dlya-interneta](https://rsshub.app/lrepacks/repaki-programm-dlya-interneta) |
| [Мультимедиа программы](https://lrepacks.net/repaki-multimedia-programm/)       | [repaki-multimedia-programm](https://rsshub.app/lrepacks/repaki-multimedia-programm)         |
| [Программы для офиса](https://lrepacks.net/repaki-programm-dlya-ofisa/)         | [repaki-programm-dlya-ofisa](https://rsshub.app/lrepacks/repaki-programm-dlya-ofisa)         |
| [Разные программы](https://lrepacks.net/repaki-raznyh-programm/)                | [repaki-raznyh-programm](https://rsshub.app/lrepacks/repaki-raznyh-programm)                 |
| [Системные библиотеки](https://lrepacks.net/sistemnye-biblioteki/)              | [sistemnye-biblioteki](https://rsshub.app/lrepacks/sistemnye-biblioteki)                     |
| [Важная информация](https://lrepacks.net/informaciya/)                          | [informaciya](https://rsshub.app/lrepacks/informaciya)                                       |
:::`,categories:[`program-update`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`lrepacks.net/:category`],target:e=>{let t=e.category;return`/lrepacks${t?`/${t}`:``}`}},{title:`Новые репаки на сегодня`,source:[`lrepacks.net/novye-repaki-elchupacabra/`],target:`/novye-repaki-elchupacabra`},{title:`Системные программы`,source:[`lrepacks.net/repaki-sistemnyh-programm/`],target:`/repaki-sistemnyh-programm`},{title:`Программы для графики`,source:[`lrepacks.net/repaki-programm-dlya-grafiki/`],target:`/repaki-programm-dlya-grafiki`},{title:`Программы для интернета`,source:[`lrepacks.net/repaki-programm-dlya-interneta/`],target:`/repaki-programm-dlya-interneta`},{title:`Мультимедиа программы`,source:[`lrepacks.net/repaki-multimedia-programm/`],target:`/repaki-multimedia-programm`},{title:`Программы для офиса`,source:[`lrepacks.net/repaki-programm-dlya-ofisa/`],target:`/repaki-programm-dlya-ofisa`},{title:`Разные программы`,source:[`lrepacks.net/repaki-raznyh-programm/`],target:`/repaki-raznyh-programm`},{title:`Системные библиотеки`,source:[`lrepacks.net/sistemnye-biblioteki/`],target:`/sistemnye-biblioteki`},{title:`Важная информация`,source:[`lrepacks.net/informaciya/`],target:`/informaciya`}]};export{u as handler,d as route};