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{jsx as r}from"hono/jsx/jsx-runtime";import{load as i}from"cheerio";import{renderToString as a}from"hono/jsx/dom/server";const o=async o=>{let{category:s=`newly`}=o.req.param(),c=Number.parseInt(o.req.query(`limit`)??`30`,10),l=`https://www.199it.com`,u=new URL(s,l).href,d=i(await e(u)),f=d(`html`).attr(`lang`)??`zh-CN`,p=d(`article.newsplus`).slice(0,c).toArray().map(e=>{let t=d(e),r=t.find(`h2.entry-title`).text(),i=t.find(`time.entry-date`).attr(`datetime`),a=t.find(`h2.entry-title a`).attr(`href`),o=t.find(`ul.post-categories li:not(submenu-parent)`).toArray(),s=[...new Set(o.map(e=>d(e).text()).filter(Boolean))],c=t.find(`img.attachment-post-thumbnail`).attr(`src`),u=i;return{title:r,pubDate:i?n(i):void 0,link:a?new URL(a,l).href:void 0,category:s,image:c,banner:c,updated:u?n(u):void 0,language:f}});p=(await Promise.all(p.map(o=>o.link?t.tryGet(o.link,async()=>{let t=i(await e(o.link));t(`div.entry-content img.alignnone`).each((e,n)=>{let i=t(n),o=i.attr(`src`);i.replaceWith(o?a(r(`figure`,{children:r(`img`,{src:o,width:i.attr(`width`),height:i.attr(`height`)})})):``)});let s=t(`h1.entry-title`).text(),c=t(`time.entry-date`).attr(`datetime`),l=t(`ul.post-categories li`).toArray(),u=[...new Set(l.map(e=>t(e).text()).filter(Boolean))],d=c,p={title:s,pubDate:c?n(c):o.pubDate,category:u,updated:d?n(d):o.updated,language:f},m=t(`ul.related_post li a`).toArray().map(e=>{let n=t(e);return{url:n.attr(`href`),type:`related`,content_html:n.text()}}).filter(e=>!0);m&&(p={...p,_extra:{links:m}}),t(`ul.related_post`).parent().remove();let h=t(`div.entry-content`).html();return p={...p,description:h,content:{html:h,text:h}},{...o,...p}}):o))).filter(e=>!0);let m=d(`title`).text();return{title:m,description:d(`meta[name="description"]`).attr(`content`),link:u,item:p,allowEmpty:!0,image:d(`h3.site-title img`).attr(`src`),author:m.split(/-/).pop()?.trim(),language:f,id:u}},s={path:`/:category{.+}?`,name:`资讯`,url:`199it.com`,maintainers:[`nczitzk`],handler:o,example:`/199it/newly`,parameters:{category:{description:"分类，默认为 `newly`，即最新，可在对应分类页 URL 中找到",options:[{label:`最新`,value:`newly`},{label:`报告`,value:`archives/category/report`},{label:`新兴产业`,value:`archives/category/emerging`},{label:`金融科技`,value:`archives/category/fintech`},{label:`共享经济`,value:`archives/category/sharingeconomy`},{label:`移动互联网`,value:`archives/category/mobile-internet`},{label:`电子商务`,value:`archives/category/electronic-commerce`},{label:`社交网络`,value:`archives/category/social-network`},{label:`网络广告`,value:`archives/category/advertising`},{label:`投资&amp;经济，互联网金融`,value:`archives/category/economic-data`},{label:`服务`,value:`archives/category/service`},{label:`网络服务行业`,value:`archives/category/dataindustry`},{label:`用户研究`,value:`archives/category/internet-users`}]}},description:`::: tip
若订阅 [研究报告](https://www.199it.com/archives/category/report)，网址为 \`https://www.199it.com/archives/category/report\`，请截取 \`https://www.199it.com/archives/category/report\` 到末尾的部分 \`archives/category/report\` 作为 \`category\` 参数填入，此时目标路由为 [\`/199it/archives/category/report\`](https://rsshub.app/199it/archives/category/report)。
:::

<details>
  <summary>更多分类</summary>

| 分类                                                                              | ID                                                                                                      |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| [报告](http://www.199it.com/archives/category/report)                             | [archives/category/report](https://rsshub.app/199it/archives/category/report)                           |
| [新兴产业](http://www.199it.com/archives/category/emerging)                       | [archives/category/emerging](https://rsshub.app/199it/archives/category/emerging)                       |
| [金融科技](http://www.199it.com/archives/category/fintech)                        | [archives/category/fintech](https://rsshub.app/199it/archives/category/fintech)                         |
| [共享经济](http://www.199it.com/archives/category/sharingeconomy)                 | [archives/category/sharingeconomy](https://rsshub.app/199it/archives/category/sharingeconomy)           |
| [移动互联网](http://www.199it.com/archives/category/mobile-internet)              | [archives/category/mobile-internet](https://rsshub.app/199it/archives/category/mobile-internet)         |
| [电子商务](http://www.199it.com/archives/category/electronic-commerce)            | [archives/category/electronic-commerce](https://rsshub.app/199it/archives/category/electronic-commerce) |
| [社交网络](http://www.199it.com/archives/category/social-network)                 | [archives/category/social-network](https://rsshub.app/199it/archives/category/social-network)           |
| [网络广告](http://www.199it.com/archives/category/advertising)                    | [archives/category/advertising](https://rsshub.app/199it/archives/category/advertising)                 |
| [投资&amp;经济，互联网金融](http://www.199it.com/archives/category/economic-data) | [archives/category/economic-data](https://rsshub.app/199it/archives/category/economic-data)             |
| [服务](http://www.199it.com/archives/category/service)                            | [archives/category/service](https://rsshub.app/199it/archives/category/service)                         |
| [网络服务行业](http://www.199it.com/archives/category/dataindustry)               | [archives/category/dataindustry](https://rsshub.app/199it/archives/category/dataindustry)               |
| [用户研究](http://www.199it.com/archives/category/internet-users)                 | [archives/category/internet-users](https://rsshub.app/199it/archives/category/internet-users)           |

</details>
`,categories:[`new-media`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`www.199it.com/:category`],target:e=>{let t=e.category;return`/199it${t?`/${t}`:``}`}},{title:`最新`,source:[`www.199it.com/newly`],target:`/newly`},{title:`报告`,source:[`www.199it.com/archives/category/report`],target:`/archives/category/report`},{title:`新兴产业`,source:[`www.199it.com/archives/category/emerging`],target:`/archives/category/emerging`},{title:`金融科技`,source:[`www.199it.com/archives/category/fintech`],target:`/archives/category/fintech`},{title:`共享经济`,source:[`www.199it.com/archives/category/sharingeconomy`],target:`/archives/category/sharingeconomy`},{title:`移动互联网`,source:[`www.199it.com/archives/category/mobile-internet`],target:`/archives/category/mobile-internet`},{title:`电子商务`,source:[`www.199it.com/archives/category/electronic-commerce`],target:`/archives/category/electronic-commerce`},{title:`社交网络`,source:[`www.199it.com/archives/category/social-network`],target:`/archives/category/social-network`},{title:`网络广告`,source:[`www.199it.com/archives/category/advertising`],target:`/archives/category/advertising`},{title:`投资&amp;经济，互联网金融`,source:[`www.199it.com/archives/category/economic-data`],target:`/archives/category/economic-data`},{title:`服务`,source:[`www.199it.com/archives/category/service`],target:`/archives/category/service`},{title:`网络服务行业`,source:[`www.199it.com/archives/category/dataindustry`],target:`/archives/category/dataindustry`},{title:`用户研究`,source:[`www.199it.com/archives/category/internet-users`],target:`/archives/category/internet-users`}],view:0};export{o as handler,s as route};