import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.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,description:t})=>a(r,{children:[e?.map(e=>e?.src?i(`figure`,{children:i(`img`,{src:e.src,alt:e.alt})}):null),t?c(t):null]}),u=e=>s(i(l,{...e})),d=async r=>{let{id:i=`all`}=r.req.param(),a=Number.parseInt(r.req.query(`limit`)??`50`,10),s=`https://www.cbndata.com`,c=new URL(`information?tag_id=${i}`,s).href,l=new URL(`api/v3/informations`,s).href,d=o(await e(c)),f=d(`html`).attr(`lang`)??`zh`,p=await e(l,{query:{page:1,per_page:a}}),m=p.data.slice(0,a).map(e=>{let t=e.title,r=e.image,i=u({images:r?[{src:r,alt:t}]:void 0}),a=e.date,o=e.id?`information/${e.id}`:void 0,c=e.tags,l=`cbndata-information-${e.id}`,d=a;return{title:t,description:i,pubDate:a?n(a):void 0,link:o?new URL(o,s).href:void 0,category:c,guid:l,id:l,content:{html:i,text:i},image:r,banner:r,updated:d?n(d):void 0,language:f}});m=await Promise.all(m.map(r=>r.link?t.tryGet(r.link,async()=>{let t=(await e(r.link)).match(/<script>window\.__INITIAL_STATE__=(.*?);<\/script>/)?.[1];if(!t)return r;let i=JSON.parse(t)?.data;if(!i)return r;let a=i.title,o=r.description+u({description:i.content}),c=i.date,l=i.id?`information/${i.id}`:void 0,d=[...new Set((i.tags?.map(e=>e.name)??[]).filter(Boolean))],p=[{name:i.author,url:void 0,avatar:void 0}],m=`cbndata-information-${i.id}`,h=i.thumbnail_url,g=c,_={title:a,description:o,pubDate:c?n(c):void 0,link:l?new URL(l,s).href:void 0,category:d,author:p,guid:m,id:m,content:{html:o,text:o},image:h,banner:h,updated:g?n(g):void 0,language:f};return{...r,..._}}):r));let h=p.home_tags.find(e=>String(e.id)===i)?.name??``,g=`${h?`${h}-`:``}${d(`title`).text().trim()}`;return{title:g,description:d(`meta[name="description"]`).attr(`content`),link:c,item:m,allowEmpty:!0,image:d(`img.logo-logoImage`).attr(`src`),author:g.split(/\|/).pop(),language:f,id:c}},f={path:`/information/:id?`,name:`看点`,url:`www.cbndata.com`,maintainers:[`nczitzk`],handler:d,example:`/cbndata/information/all`,parameters:{id:{description:"分类，默认为 `all`，即全部，可在对应分类页 URL 中找到",options:[{label:`全部`,value:`all`},{label:`美妆个护`,value:`1`},{label:`服饰鞋包`,value:`2559`},{label:`宠物`,value:`2419`},{label:`营销`,value:`2484`}]}},description:`::: tip
订阅 [美妆个护](https://www.cbndata.com/information?tag_id=1)，其源网址为 \`https://www.cbndata.com/information?tag_id=1\`，请参考该 URL 指定部分构成参数，此时路由为 [\`/cbndata/information/1\`](https://rsshub.app/cbndata/information/1)。
:::

| 分类                                                        | ID                                                  |
| ----------------------------------------------------------- | --------------------------------------------------- |
| [全部](https://www.cbndata.com/information?tag_id=all)      | [all](https://rsshub.app/cbndata/information/all)   |
| [美妆个护](https://www.cbndata.com/information?tag_id=1)    | [1](https://rsshub.app/cbndata/information/1)       |
| [服饰鞋包](https://www.cbndata.com/information?tag_id=2559) | [2559](https://rsshub.app/cbndata/information/2559) |
| [宠物](https://www.cbndata.com/information?tag_id=2419)     | [2419](https://rsshub.app/cbndata/information/2419) |
| [营销](https://www.cbndata.com/information?tag_id=2484)     | [2484](https://rsshub.app/cbndata/information/2484) |
`,categories:[`new-media`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`www.cbndata.com/information`],target:(e,t)=>{let n=new URL(t).searchParams.get(`tag_id`)??void 0;return`/information${n?`/${n}`:``}`}},{title:`全部`,source:[`www.cbndata.com/information`],target:`/information/all`},{title:`美妆个护`,source:[`www.cbndata.com/information`],target:`/information/1`},{title:`服饰鞋包`,source:[`www.cbndata.com/information`],target:`/information/2559`},{title:`宠物`,source:[`www.cbndata.com/information`],target:`/information/2419`},{title:`营销`,source:[`www.cbndata.com/information`],target:`/information/2484`}],view:0};export{d as handler,f as route};