import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{load as r}from"cheerio";const i={path:`/mem/gk/zfxxgkpt/fdzdgknr`,categories:[`government`],example:`/gov/mem/gk/zfxxgkpt/fdzdgknr`,parameters:{},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`www.mem.gov.cn/gk/zfxxgkpt/fdzdgknr`],target:`/mem/gk/zfxxgkpt/fdzdgknr`}],name:`法定主动公开内容`,maintainers:[`skeaven`],handler:a,description:`应急管理部法定主动公开内容,包含通知、公告、督办、政策解读等，可供应急相关工作人员及时获取政策信息`};async function a(a){let o=a.req.query(`limit`)?Number.parseInt(a.req.query(`limit`),10):30,s=`https://www.mem.gov.cn`,c=new URL(`gk/zfxxgkpt/fdzdgknr/`,s).href,{data:l}=await n(c),{data:u}=await n(r(l)(`div.scy_main_r iframe`).attr(`src`)),d=r(u),f=new URL(`favicon.ico`,s).href,p=d(`div.scy_main_V2_list`).find(`tr`).slice(1,o).toArray().map(e=>{let n=d(e).find(`a[href]`);if(n.attr(`href`)){let r=c+n.attr(`href`).replaceAll(`..`,``);return{title:n.contents().first().text(),link:r,pubDate:t(d(e).find(`.fbsj`).text())}}else return null}).filter(Boolean);return p=await Promise.all(p.map(t=>e.tryGet(t.link,async()=>{if(!t.link.endsWith(`.html`)&&!t.link.endsWith(`.shtml`))return t;let{data:e}=await n(t.link),i=r(e),a=i(`#content`).html(),o=i(`td.td_lable:contains("所属机构")`).next(`td`).text().trim(),s=i(`td.td_lable:contains("主题分类")`).next(`td`).text().trim();return{...t,description:a,author:o||`未知机构`,category:s||`未知分类`}}))),{item:p,title:i.name,link:c,icon:f}}export{i as route};