import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./config-BYRrjYC5.mjs";import{t as n}from"./header-generator-D_8tgMao.mjs";const r={path:`/user/:id`,categories:[`shopping`],example:`/dianping/user/808259118`,parameters:{id:"User id，打开网页端从 URL 中获取，在 `/member/:id` 中"},features:{requireConfig:[{name:`DIANPING_COOKIE`,optional:!1,description:`大众点评的 Cookie`}],requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`dianping.com/member/:id`],target:`/dianping/user/:id`},{source:[`m.dianping.com/userprofile/:id`],target:`/dianping/user/:id`}],name:`用户动态`,maintainers:[`pseudoyu`],handler:o,description:`获取用户点评、签到、攻略等动态。`};function i(e){let t=``;return t+=e.pictureList?e.pictureList.map(e=>`<img src="${e.picUrl}" />`).join(`<br>`):``,t+=e.videoUrl?`<img src="${e.videoUrl}" />`:``,t}const a={0:`无`,10:`一星`,20:`二星`,30:`三星`,35:`三星半`,40:`四星`,45:`四星半`,50:`五星`};async function o(r){let o=r.req.param(`id`),s=`https://m.dianping.com/userprofile/${o}`,c=t.dianping.cookie,l={Referer:s};c&&(l.Cookie=c);let u=await e(s,{headers:l,headerGeneratorOptions:n.MODERN_IOS}),d=/window\.nickName = "(.*?)"/g.exec(u)?.[1],f=(await e(`https://m.dianping.com/member/ajax/NobleUserFeeds?userId=${o}`,{headers:l,headerGeneratorOptions:n.MODERN_IOS})).data.map(e=>{let t=``,n=``,r=``,o=e.poi?`地点：<a href="http://www.dianping.com/shop/${e.poi.shopId}">${e.poi.name} - ${e.poi.regionCategory}</a>`:``,s=e.poi?e.poi.name:``;switch(e.feedType){case 1101:t=`https://m.dianping.com/ugcdetail/${e.mainId}?sceneType=0&bizType=3`,r=o,n=`签到成功: ${s} `;break;case 101:t=`https://m.dianping.com/ugcdetail/${e.mainId}?sceneType=0&bizType=1`,r=e.content.replaceAll(/\n+/g,`<br>`)+`<br>`,r+=`评分：${a[e.star]}<br>`,r+=o+`<br>`,r+=i(e),n=`发布点评: ${s}`;break;case 131:t=`https://m.dianping.com/ugcdetail/${e.mainId}?sceneType=0&bizType=29`,r=e.content.replaceAll(/\n+/g,`<br>`)+`<br>`,r+=i(e),n=`发布点评: ${r}`;break;case 4208:t=`https://m.dianping.com/cityinsight/${e.mainId}`,r=e.content.replaceAll(/\n+/g,`<br>`)+`<br>`,r+=o+`<br>`,r+=e.moreDesc?`<a href='${t}'>${e.moreDesc}</a><br>`:``,r+=i(e),n=`发布攻略: ${s}`;break;default:}return{description:r,title:n,link:t}});return{title:`大众点评 - ${d}`,link:s,description:`大众点评 - ${d}`,item:f}}export{r as route};