import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{t as r}from"./utils-DwzuUs2Z.mjs";import{load as i}from"cheerio";const a={path:`/subject/:id`,categories:[`finance`],view:0,example:`/gelonghui/subject/4`,parameters:{id:`主题编号，可在主题页 URL 中找到`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`gelonghui.com/subject/:id`]}],name:`主题文章`,maintainers:[`nczitzk`],handler:o};async function o(a){let o=a.req.param(`id`),s=`https://www.gelonghui.com/api/subjects/${o}/contents`,{data:c}=await n(`https://www.gelonghui.com/subject/${o}`),{data:l}=await n(s,{searchParams:{isChoice:!1}}),u=i(c),d=l.result.map(e=>({title:e.title,description:e.summary,link:e.link,author:e.source,pubDate:t(e.timestamp,`X`)})),f=await Promise.all(d.map(t=>r(t,e.tryGet)));return{title:`格隆汇 - 主题 ${u(`span.user-nick`).text()} 的文章`,description:u(`div.user-name`).parent().children(`p`).text(),image:u(`.subject-list-title`).find(`img`).attr(`data-src`),link:`https://www.gelonghui.com/subject/${o}`,item:f}}export{a as route};